1 | <?php |
||
23 | trait CommentCountTrait |
||
24 | { |
||
25 | /** |
||
26 | * Number of comments. |
||
27 | * |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $commentCount; |
||
31 | |||
32 | /** |
||
33 | * An array of comments. |
||
34 | * |
||
35 | * @var array<\BenatEspina\StackExchangeApiClient\Model\Interfaces\CommentInterface>|null |
||
36 | */ |
||
37 | protected $comments = []; |
||
38 | |||
39 | /** |
||
40 | * Sets number of comments. |
||
41 | * |
||
42 | * @param int $commentCount The number of comments |
||
43 | * |
||
44 | * @return $this self Object |
||
45 | */ |
||
46 | public function setCommentCount($commentCount) |
||
52 | |||
53 | /** |
||
54 | * Gets number of comments. |
||
55 | * |
||
56 | * @return int |
||
57 | */ |
||
58 | public function getCommentCount() |
||
62 | |||
63 | /** |
||
64 | * Adds comment. |
||
65 | * |
||
66 | * @param \BenatEspina\StackExchangeApiClient\Model\Interfaces\CommentInterface|null $comment The comment object |
||
|
|||
67 | * |
||
68 | * @return $this self Object |
||
69 | */ |
||
70 | public function addComment(CommentInterface $comment) |
||
76 | |||
77 | /** |
||
78 | * Removes comment. |
||
79 | * |
||
80 | * @param \BenatEspina\StackExchangeApiClient\Model\Interfaces\CommentInterface|null $comment The comment object |
||
81 | * |
||
82 | * @return $this self Object |
||
83 | */ |
||
84 | public function removeComment(CommentInterface $comment) |
||
90 | |||
91 | /** |
||
92 | * Gets array of comments. |
||
93 | * |
||
94 | * @return array<\BenatEspina\StackExchangeApiClient\Model\Interfaces\CommentInterface>|null |
||
95 | */ |
||
96 | public function getComments() |
||
100 | |||
101 | /** |
||
102 | * Loads the variables if the data exist into resource. It works like a constructor. |
||
103 | * |
||
104 | * @param null|mixed[] $resource The resource |
||
105 | */ |
||
106 | protected function loadCommentCount($resource) |
||
114 | } |
||
115 |