1 | <?php |
||
21 | trait FavoriteTrait |
||
22 | { |
||
23 | /** |
||
24 | * Number of favorite votes. |
||
25 | * |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $favoriteCount; |
||
29 | |||
30 | /** |
||
31 | * Boolean that shows it it is favorited or not. |
||
32 | * |
||
33 | * @var boolean. |
||
34 | */ |
||
35 | protected $favorited; |
||
36 | |||
37 | /** |
||
38 | * Sets number of favorites. |
||
39 | * |
||
40 | * @param int $favoriteCount The number of favorites |
||
41 | * |
||
42 | * @return $this self Object |
||
43 | */ |
||
44 | public function setFavoriteCount($favoriteCount) |
||
50 | |||
51 | /** |
||
52 | * Gets number of favorites. |
||
53 | * |
||
54 | * @return int |
||
55 | */ |
||
56 | public function getFavoriteCount() |
||
60 | |||
61 | /** |
||
62 | * Sets is favorited. |
||
63 | * |
||
64 | * @param bool $favorited The favorited boolean |
||
65 | * |
||
66 | * @return $this self Object |
||
67 | */ |
||
68 | public function setFavorited($favorited) |
||
74 | |||
75 | /** |
||
76 | * Gets is favorited. |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function isFavorited() |
||
84 | |||
85 | /** |
||
86 | * Loads the variables if the data exist into resource. It works like a constructor. |
||
87 | * |
||
88 | * @param null|mixed[] $resource The resource |
||
89 | */ |
||
90 | protected function loadFavorite($resource) |
||
95 | } |
||
96 |