@@ -19,6 +19,9 @@ |
||
19 | 19 | |
20 | 20 | private $collection; |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $collectionName |
|
24 | + */ |
|
22 | 25 | public function __construct(Database $database, $collectionName) |
23 | 26 | { |
24 | 27 | $this->collection = $database |
@@ -114,6 +114,9 @@ |
||
114 | 114 | return $this->dbVersion; |
115 | 115 | } |
116 | 116 | |
117 | + /** |
|
118 | + * @param string $dsn |
|
119 | + */ |
|
117 | 120 | public function setDsn($dsn) |
118 | 121 | { |
119 | 122 | $this->dsn = $dsn; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | * Create document query builder |
358 | 358 | * |
359 | 359 | * @param $callable callable|null Function to configure query builder& |
360 | - * @return \Sokil\Mongo\Cursor|\Sokil\Mongo\Expression |
|
360 | + * @return Cursor |
|
361 | 361 | */ |
362 | 362 | public function find($callable = null) |
363 | 363 | { |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | /** |
440 | 440 | * Store document to pool |
441 | 441 | * |
442 | - * @param array $document |
|
442 | + * @param Document $document |
|
443 | 443 | * @return \Sokil\Mongo\Collection |
444 | 444 | */ |
445 | 445 | public function addDocumentToDocumentPool(Document $document) |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | * |
581 | 581 | * @param string|\MongoId $id |
582 | 582 | * @param callable $callable cursor callable used to configure cursor |
583 | - * @return \Sokil\Mongo\Document|array|null |
|
583 | + * @return Document |
|
584 | 584 | */ |
585 | 585 | public function getDocumentDirectly($id, $callable = null) |
586 | 586 | { |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | * Check if document belongs to collection |
601 | 601 | * |
602 | 602 | * @param \Sokil\Mongo\Document $document |
603 | - * @return type |
|
603 | + * @return boolean |
|
604 | 604 | */ |
605 | 605 | public function hasDocument(Document $document) |
606 | 606 | { |
@@ -52,6 +52,9 @@ discard block |
||
52 | 52 | */ |
53 | 53 | private $collectionPoolEnabled = true; |
54 | 54 | |
55 | + /** |
|
56 | + * @param string $database |
|
57 | + */ |
|
55 | 58 | public function __construct(Client $client, $database) { |
56 | 59 | $this->client = $client; |
57 | 60 | |
@@ -142,7 +145,7 @@ discard block |
||
142 | 145 | /** |
143 | 146 | * Reset specified mapping |
144 | 147 | * |
145 | - * @return \Sokil\Mongo\Client |
|
148 | + * @return Database |
|
146 | 149 | */ |
147 | 150 | public function resetMapping() |
148 | 151 | { |
@@ -157,7 +160,7 @@ discard block |
||
157 | 160 | * |
158 | 161 | * @param string|array $name collection name or array like [collectionName => collectionClass, ...] |
159 | 162 | * @param string|array|null $classDefinition if $name is string, then full class name or array with parameters, else omitted |
160 | - * @return \Sokil\Mongo\Client |
|
163 | + * @return Database |
|
161 | 164 | */ |
162 | 165 | public function map($name, $classDefinition = null) |
163 | 166 | { |
@@ -224,7 +227,7 @@ discard block |
||
224 | 227 | * Get class name mapped to collection |
225 | 228 | * @param string $name name of collection |
226 | 229 | * @param array $defaultDefinition definition used when no definition found for defined class |
227 | - * @return string|array name of class or array of class definition |
|
230 | + * @return string name of class or array of class definition |
|
228 | 231 | */ |
229 | 232 | private function getCollectionDefinition($name, array $defaultDefinition = null) |
230 | 233 | { |
@@ -181,11 +181,17 @@ discard block |
||
181 | 181 | return $this->options; |
182 | 182 | } |
183 | 183 | |
184 | + /** |
|
185 | + * @param string $name |
|
186 | + */ |
|
184 | 187 | public function getOption($name, $default = null) |
185 | 188 | { |
186 | 189 | return isset($this->options[$name]) ? $this->options[$name] : $default; |
187 | 190 | } |
188 | 191 | |
192 | + /** |
|
193 | + * @param string $name |
|
194 | + */ |
|
189 | 195 | public function hasOption($name) |
190 | 196 | { |
191 | 197 | return isset($this->options[$name]); |
@@ -1297,7 +1303,7 @@ discard block |
||
1297 | 1303 | |
1298 | 1304 | /** |
1299 | 1305 | * |
1300 | - * @return \Sokil\Mongo\RevisionManager |
|
1306 | + * @return RevisionManager |
|
1301 | 1307 | */ |
1302 | 1308 | public function getRevisionManager() |
1303 | 1309 | { |
@@ -32,6 +32,9 @@ discard block |
||
32 | 32 | return $this; |
33 | 33 | } |
34 | 34 | |
35 | + /** |
|
36 | + * @param string $fieldName |
|
37 | + */ |
|
35 | 38 | public function push($fieldName, $value) |
36 | 39 | { |
37 | 40 | // value must be list, not dictionary |
@@ -68,6 +71,9 @@ discard block |
||
68 | 71 | return $this; |
69 | 72 | } |
70 | 73 | |
74 | + /** |
|
75 | + * @param string $fieldName |
|
76 | + */ |
|
71 | 77 | public function pushEach($fieldName, array $values) |
72 | 78 | { |
73 | 79 | // value must be list, not dictionary |
@@ -296,6 +302,9 @@ discard block |
||
296 | 302 | return $this; |
297 | 303 | } |
298 | 304 | |
305 | + /** |
|
306 | + * @param string $operation |
|
307 | + */ |
|
299 | 308 | public function get($operation, $fieldName = null) |
300 | 309 | { |
301 | 310 | if($fieldName) { |
@@ -331,7 +340,7 @@ discard block |
||
331 | 340 | /** |
332 | 341 | * Transform operator in different formats to canonical array form |
333 | 342 | * |
334 | - * @param mixed $mixed |
|
343 | + * @param callable $mixed |
|
335 | 344 | * @return array |
336 | 345 | * @throws \Sokil\Mongo\Exception |
337 | 346 | */ |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @param string $selector |
62 | 62 | * @param string|callable $className string class name or closure, which accept data and return string class name |
63 | - * @return object representation of document with class, passed as argument |
|
63 | + * @return null|Structure representation of document with class, passed as argument |
|
64 | 64 | * @throws \Sokil\Mongo\Exception |
65 | 65 | */ |
66 | 66 | public function getObject($selector, $className) |
@@ -208,6 +208,9 @@ discard block |
||
208 | 208 | return $this; |
209 | 209 | } |
210 | 210 | |
211 | + /** |
|
212 | + * @param string $selector |
|
213 | + */ |
|
211 | 214 | public function has($selector) |
212 | 215 | { |
213 | 216 | $pointer = &$this->_data; |
@@ -263,6 +266,9 @@ discard block |
||
263 | 266 | return (array) $value; |
264 | 267 | } |
265 | 268 | |
269 | + /** |
|
270 | + * @param string $selector |
|
271 | + */ |
|
266 | 272 | public function unsetField($selector) |
267 | 273 | { |
268 | 274 | // modify |
@@ -331,6 +337,9 @@ discard block |
||
331 | 337 | return $this; |
332 | 338 | } |
333 | 339 | |
340 | + /** |
|
341 | + * @param string $selector |
|
342 | + */ |
|
334 | 343 | public function isModified($selector = null) |
335 | 344 | { |
336 | 345 | if(!$this->_modifiedFields) { |
@@ -12,7 +12,6 @@ |
||
12 | 12 | namespace Sokil\Mongo; |
13 | 13 | |
14 | 14 | use Sokil\Mongo\Pipeline\GroupStage; |
15 | - |
|
16 | 15 | use Sokil\Mongo\ArrayableInterface; |
17 | 16 | |
18 | 17 | class Pipeline implements |