1 | <?php |
||
31 | class DocumentRepository implements ObjectRepository, Selectable |
||
32 | { |
||
33 | /** @var string */ |
||
34 | protected $documentName; |
||
35 | |||
36 | /** @var DocumentManager */ |
||
37 | protected $dm; |
||
38 | |||
39 | /** @var UnitOfWork */ |
||
40 | protected $uow; |
||
41 | |||
42 | /** @var ClassMetadata */ |
||
43 | protected $class; |
||
44 | |||
45 | /** |
||
46 | * Initializes this instance with the specified document manager, unit of work and |
||
47 | * class metadata. |
||
48 | * |
||
49 | * @param DocumentManager $dm The DocumentManager to use. |
||
50 | * @param UnitOfWork $uow The UnitOfWork to use. |
||
51 | * @param ClassMetadata $classMetadata The class metadata. |
||
52 | */ |
||
53 | 356 | public function __construct(DocumentManager $dm, UnitOfWork $uow, ClassMetadata $classMetadata) |
|
60 | |||
61 | /** |
||
62 | * Creates a new Query\Builder instance that is preconfigured for this document name. |
||
63 | */ |
||
64 | 15 | public function createQueryBuilder() : QueryBuilder |
|
68 | |||
69 | /** |
||
70 | * Creates a new Aggregation\Builder instance that is prepopulated for this document name. |
||
71 | */ |
||
72 | public function createAggregationBuilder() : AggregationBuilder |
||
76 | |||
77 | /** |
||
78 | * Clears the repository, causing all managed documents to become detached. |
||
79 | */ |
||
80 | public function clear() : void |
||
84 | |||
85 | /** |
||
86 | * Finds a document matching the specified identifier. Optionally a lock mode and |
||
87 | * expected version may be specified. |
||
88 | * |
||
89 | * @param mixed $id Identifier. |
||
90 | * |
||
91 | * @throws MappingException |
||
92 | * @throws LockException |
||
93 | */ |
||
94 | 249 | public function find($id, int $lockMode = LockMode::NONE, ?int $lockVersion = null) : ?object |
|
142 | |||
143 | /** |
||
144 | * Finds all documents in the repository. |
||
145 | */ |
||
146 | 10 | public function findAll() : array |
|
150 | |||
151 | /** |
||
152 | * Finds documents by a set of criteria. |
||
153 | * |
||
154 | * @param int|null $limit |
||
155 | * @param int|null $skip |
||
156 | */ |
||
157 | 11 | public function findBy(array $criteria, ?array $sort = null, $limit = null, $skip = null) : array |
|
161 | |||
162 | /** |
||
163 | * Finds a single document by a set of criteria. |
||
164 | */ |
||
165 | 84 | public function findOneBy(array $criteria) : ?object |
|
169 | |||
170 | 8 | public function getDocumentName() : string |
|
174 | |||
175 | public function getDocumentManager() : DocumentManager |
||
179 | |||
180 | public function getClassMetadata() : ClassMetadata |
||
184 | |||
185 | 8 | public function getClassName() : string |
|
189 | |||
190 | /** |
||
191 | * Selects all elements from a selectable that match the expression and |
||
192 | * returns a new collection containing these elements. |
||
193 | * |
||
194 | * @see Selectable::matching() |
||
195 | */ |
||
196 | 4 | public function matching(Criteria $criteria) : ArrayCollection |
|
221 | |||
222 | 334 | protected function getDocumentPersister() : DocumentPersister |
|
226 | } |
||
227 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.