From 42b213ac85079b073b905a7c1de1d149cd9277f7 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Mon, 1 Jun 2015 03:39:14 +0300 Subject: [PATCH] Basic implementation of blogs (posts, comments, tags). No migration yet. --- .../PointToolsBundle/Entity/Blogs/Comment.php | 234 ++++++++++++++++ .../PointToolsBundle/Entity/Blogs/Post.php | 251 ++++++++++++++++++ .../PointToolsBundle/Entity/Blogs/Tag.php | 64 +++++ 3 files changed, 549 insertions(+) create mode 100644 src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Comment.php create mode 100644 src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Post.php create mode 100644 src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Tag.php diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Comment.php b/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Comment.php new file mode 100644 index 0000000..cf4a44f --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Comment.php @@ -0,0 +1,234 @@ +id; + } + + /** + * Set createdAt + * + * @param \DateTime $createdAt + * @return Comment + */ + public function setCreatedAt($createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * Get createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + * Set text + * + * @param string $text + * @return Comment + */ + public function setText($text) + { + $this->text = $text; + + return $this; + } + + /** + * Get text + * + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Set isRec + * + * @param boolean $isRec + * @return Comment + */ + public function setIsRec($isRec) + { + $this->isRec = $isRec; + + return $this; + } + + /** + * Get isRec + * + * @return boolean + */ + public function isRec() + { + return $this->isRec; + } + + /** + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * @param int $number + * @return Comment + */ + public function setNumber($number) + { + $this->number = $number; + + return $this; + } + + /** + * @return Post + */ + public function getPost() + { + return $this->post; + } + + /** + * @param Post $post + * @return Comment + */ + public function setPost($post) + { + $this->post = $post; + + return $this; + } + + /** + * @return User + */ + public function getAuthor() + { + return $this->author; + } + + /** + * @param User $author + * @return Comment + */ + public function setAuthor($author) + { + $this->author = $author; + + return $this; + } + + /** + * @return Comment + */ + public function getToComment() + { + return $this->toComment; + } + + /** + * @param Comment $toComment + * @return Comment + */ + public function setToComment($toComment) + { + $this->toComment = $toComment; + + return $this; + } + + +} diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Post.php b/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Post.php new file mode 100644 index 0000000..28ee669 --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Post.php @@ -0,0 +1,251 @@ +tags = new ArrayCollection(); + $this->comments = new ArrayCollection(); + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set uid + * + * @param integer $uid + * @return Post + */ + public function setUid($uid) + { + $this->uid = $uid; + + return $this; + } + + /** + * Get uid + * + * @return integer + */ + public function getUid() + { + return $this->uid; + } + + /** + * Set text + * + * @param string $text + * @return Post + */ + public function setText($text) + { + $this->text = $text; + + return $this; + } + + /** + * Get text + * + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Set createdAt + * + * @param \DateTime $createdAt + * @return Post + */ + public function setCreatedAt($createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * Get createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + * Set type + * + * @param string $type + * @return Post + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + /** + * Get type + * + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @return User + */ + public function getAuthor() + { + return $this->author; + } + + /** + * @param User $author + * @return Post + */ + public function setAuthor($author) + { + $this->author = $author; + return $this; + } + + + /** + * Set id + * + * @param string $id + * @return Post + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * Add tags + * + * @param Tag $tags + * @return Post + */ + public function addTag(Tag $tags) + { + $this->tags[] = $tags; + + return $this; + } + + /** + * Remove tags + * + * @param Tag $tags + */ + public function removeTag(Tag $tags) + { + $this->tags->removeElement($tags); + } + + /** + * Get tags + * + * @return Collection + */ + public function getTags() + { + return $this->tags; + } +} diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Tag.php b/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Tag.php new file mode 100644 index 0000000..7a9d5ac --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Tag.php @@ -0,0 +1,64 @@ +id; + } + + /** + * Set text + * + * @param string $text + * @return Tag + */ + public function setText($text) + { + $this->text = $text; + + return $this; + } + + /** + * Get text + * + * @return string + */ + public function getText() + { + return $this->text; + } +}