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 | * Entity Listing Service needs an entity or entity class name. |
||
49 | * |
||
50 | * @param string|EntityInterface $className |
||
51 | */ |
||
52 | 10 | public function __construct($className) |
|
60 | |||
61 | /** |
||
62 | * Get a paginated list of entities |
||
63 | * |
||
64 | * @return \Slick\Orm\Entity\EntityCollection |
||
65 | */ |
||
66 | 2 | public function getList() |
|
78 | |||
79 | /** |
||
80 | * Gets the pagination object |
||
81 | * |
||
82 | * @return Pagination |
||
83 | */ |
||
84 | 4 | public function getPagination() |
|
91 | |||
92 | /** |
||
93 | * Set pagination |
||
94 | * |
||
95 | * @param Pagination $pagination |
||
96 | * |
||
97 | * @return EntityListingService |
||
98 | */ |
||
99 | 4 | public function setPagination($pagination) |
|
104 | |||
105 | /** |
||
106 | * Get query filters collection |
||
107 | * |
||
108 | * @return CollectionInterface|QueryFilterCollectionInterface |
||
109 | */ |
||
110 | 4 | public function getFilters() |
|
117 | |||
118 | /** |
||
119 | * Set filters collection |
||
120 | * |
||
121 | * @param QueryFilterCollectionInterface $filters |
||
122 | * |
||
123 | * @return EntityListingService |
||
124 | */ |
||
125 | 4 | public function setFilters(QueryFilterCollectionInterface $filters) |
|
130 | |||
131 | /** |
||
132 | * Get entity query |
||
133 | * |
||
134 | * @return RepositoryInterface |
||
135 | */ |
||
136 | 6 | public function getRepository() |
|
145 | |||
146 | /** |
||
147 | * Set entity repository |
||
148 | * |
||
149 | * @param RepositoryInterface $repository |
||
150 | * |
||
151 | * @return EntityListingService |
||
152 | */ |
||
153 | 6 | public function setRepository(RepositoryInterface $repository) |
|
158 | |||
159 | |||
160 | |||
161 | } |
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.