From 057481b808d01164329f8f5c421cbd38945ca971 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Wed, 16 Mar 2016 23:55:41 +0300 Subject: [PATCH] DTO's for crawler. Test implementation. Not tested. --- .../DTO/Api/Crawler/MetaPost.php | 59 ++++++ .../PointToolsBundle/DTO/Api/Crawler/Post.php | 184 ++++++++++++++++++ .../DTO/Api/Crawler/PostsPage.php | 35 ++++ .../DTO/Api/Crawler/Recommendation.php | 84 ++++++++ .../PointToolsBundle/DTO/Api/Crawler/User.php | 84 ++++++++ 5 files changed, 446 insertions(+) create mode 100644 src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/MetaPost.php create mode 100644 src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Post.php create mode 100644 src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/PostsPage.php create mode 100644 src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Recommendation.php create mode 100644 src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/User.php diff --git a/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/MetaPost.php b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/MetaPost.php new file mode 100644 index 0000000..c885785 --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/MetaPost.php @@ -0,0 +1,59 @@ +rec; + } + + /** + * @param Recommendation $rec + * @return MetaPost + */ + public function setRec(Recommendation $rec) + { + $this->rec = $rec; + return $this; + } + + /** + * @return Post + */ + public function getPost() + { + return $this->post; + } + + /** + * @param Post $post + * @return MetaPost + */ + public function setPost(Post $post) + { + $this->post = $post; + return $this; + } +} \ No newline at end of file diff --git a/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Post.php b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Post.php new file mode 100644 index 0000000..cd7fd8b --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Post.php @@ -0,0 +1,184 @@ +id; + } + + /** + * @param string $id + * @return Post + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * @return string[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * @param string[] $tags + * @return Post + */ + public function setTags(array $tags) + { + $this->tags = $tags; + return $this; + } + + /** + * @return User + */ + public function getAuthor() + { + return $this->author; + } + + /** + * @param User $author + * @return Post + */ + public function setAuthor(User $author) + { + $this->author = $author; + return $this; + } + + /** + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * @param string $text + * @return Post + */ + public function setText($text) + { + $this->text = $text; + return $this; + } + + /** + * @return string + */ + public function getCreated() + { + return $this->created; + } + + /** + * @param string $created + * @return Post + */ + public function setCreated($created) + { + $this->created = $created; + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + * @return Post + */ + public function setType($type) + { + $this->type = $type; + return $this; + } + + /** + * @return boolean + */ + public function isPrivate() + { + return $this->private; + } + + /** + * @param boolean $private + * @return Post + */ + public function setPrivate($private) + { + $this->private = $private; + return $this; + } +} \ No newline at end of file diff --git a/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/PostsPage.php b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/PostsPage.php new file mode 100644 index 0000000..6096bd6 --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/PostsPage.php @@ -0,0 +1,35 @@ +posts; + } + + /** + * @param MetaPost[] $posts + * @return PostsPage + */ + public function setPosts(array $posts) + { + $this->posts = $posts; + return $this; + } + + +} \ No newline at end of file diff --git a/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Recommendation.php b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Recommendation.php new file mode 100644 index 0000000..087cc01 --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/Recommendation.php @@ -0,0 +1,84 @@ +text; + } + + /** + * @param string $text + * @return Recommendation + */ + public function setText($text) + { + $this->text = $text; + return $this; + } + + /** + * @return int|null + */ + public function getComment_id() + { + return $this->comment_id; + } + + /** + * @param int|null $comment_id + * @return Recommendation + */ + public function setComment_id($comment_id) + { + $this->comment_id = $comment_id; + return $this; + } + + /** + * @return User + */ + public function getAuthor() + { + return $this->author; + } + + /** + * @param User $author + * @return Recommendation + */ + public function setAuthor(User $author) + { + $this->author = $author; + return $this; + } +} \ No newline at end of file diff --git a/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/User.php b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/User.php new file mode 100644 index 0000000..e70bb0a --- /dev/null +++ b/src/Skobkin/Bundle/PointToolsBundle/DTO/Api/Crawler/User.php @@ -0,0 +1,84 @@ +id; + } + + /** + * @param string $id + * @return User + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * @return string + */ + public function getLogin() + { + return $this->login; + } + + /** + * @param string $login + * @return User + */ + public function setLogin($login) + { + $this->login = $login; + return $this; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + * @return User + */ + public function setName($name) + { + $this->name = $name; + return $this; + } +} \ No newline at end of file