1 | <?php |
||
28 | class EntityListingService extends AbstractEntityService implements |
||
29 | EntityServiceInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * @var Pagination |
||
34 | */ |
||
35 | private $pagination; |
||
36 | |||
37 | /** |
||
38 | * @var QueryFilterInterface[]|QueryFilterCollectionInterface |
||
39 | */ |
||
40 | private $filters; |
||
41 | |||
42 | /** |
||
43 | * @var RepositoryInterface |
||
44 | */ |
||
45 | private $repository; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | private $order; |
||
51 | |||
52 | /** |
||
53 | * Entity Listing Service needs an entity or entity class name. |
||
54 | * |
||
55 | * @param string|EntityInterface $className |
||
56 | */ |
||
57 | 10 | public function __construct($className) |
|
65 | |||
66 | /** |
||
67 | * Get a paginated list of entities |
||
68 | * |
||
69 | * @return \Slick\Orm\Entity\EntityCollection |
||
70 | */ |
||
71 | 2 | public function getList() |
|
84 | |||
85 | /** |
||
86 | * Gets the pagination object |
||
87 | * |
||
88 | * @return Pagination |
||
89 | */ |
||
90 | 4 | public function getPagination() |
|
97 | |||
98 | /** |
||
99 | * Set pagination |
||
100 | * |
||
101 | * @param Pagination $pagination |
||
102 | * |
||
103 | * @return EntityListingService |
||
104 | */ |
||
105 | 4 | public function setPagination($pagination) |
|
110 | |||
111 | /** |
||
112 | * Get query filters collection |
||
113 | * |
||
114 | * @return CollectionInterface|QueryFilterCollectionInterface |
||
115 | */ |
||
116 | 4 | public function getFilters() |
|
123 | |||
124 | /** |
||
125 | * Set filters collection |
||
126 | * |
||
127 | * @param QueryFilterCollectionInterface $filters |
||
128 | * |
||
129 | * @return EntityListingService |
||
130 | */ |
||
131 | 4 | public function setFilters(QueryFilterCollectionInterface $filters) |
|
136 | |||
137 | /** |
||
138 | * Get entity query |
||
139 | * |
||
140 | * @return RepositoryInterface |
||
141 | */ |
||
142 | 4 | public function getRepository() |
|
151 | |||
152 | /** |
||
153 | * Set entity repository |
||
154 | * |
||
155 | * @param RepositoryInterface $repository |
||
156 | * |
||
157 | * @return EntityListingService |
||
158 | */ |
||
159 | 4 | public function setRepository(RepositoryInterface $repository) |
|
164 | |||
165 | /** |
||
166 | * Get the order by clause |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | 2 | public function getOrder() |
|
174 | |||
175 | /** |
||
176 | * Set the order by clause |
||
177 | * |
||
178 | * @param string $order |
||
179 | * |
||
180 | * @return EntityListingService |
||
181 | */ |
||
182 | public function setOrder($order) |
||
187 | |||
188 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.