@@ -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; |
@@ -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 |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | /** |
442 | 442 | * Store document to pool |
443 | 443 | * |
444 | - * @param array $document |
|
444 | + * @param Document $document |
|
445 | 445 | * @return \Sokil\Mongo\Collection |
446 | 446 | */ |
447 | 447 | public function addDocumentToDocumentPool(Document $document) |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | * |
583 | 583 | * @param string|\MongoId $id |
584 | 584 | * @param callable $callable cursor callable used to configure cursor |
585 | - * @return \Sokil\Mongo\Document|array|null |
|
585 | + * @return Document |
|
586 | 586 | */ |
587 | 587 | public function getDocumentDirectly($id, $callable = null) |
588 | 588 | { |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | * Check if document belongs to collection |
603 | 603 | * |
604 | 604 | * @param \Sokil\Mongo\Document $document |
605 | - * @return type |
|
605 | + * @return boolean |
|
606 | 606 | */ |
607 | 607 | public function hasDocument(Document $document) |
608 | 608 | { |
@@ -172,6 +172,9 @@ |
||
172 | 172 | return $this->whereHasType($field, FieldType::NULL); |
173 | 173 | } |
174 | 174 | |
175 | + /** |
|
176 | + * @param string $condition |
|
177 | + */ |
|
175 | 178 | public function whereJsCondition($condition) |
176 | 179 | { |
177 | 180 | return $this->where('$where', $condition); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @param Client $client |
57 | - * @param \MongoDB|string $database |
|
57 | + * @param string $database |
|
58 | 58 | */ |
59 | 59 | public function __construct(Client $client, $database) { |
60 | 60 | $this->client = $client; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | /** |
154 | 154 | * Reset specified mapping |
155 | 155 | * |
156 | - * @return \Sokil\Mongo\Client |
|
156 | + * @return Database |
|
157 | 157 | */ |
158 | 158 | public function resetMapping() |
159 | 159 | { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @param string|array $name collection name or array like [collectionName => collectionClass, ...] |
169 | 169 | * @param string|array|Definition|null $classDefinition if $name is string, then full class name or array with parameters, else omitted |
170 | - * @return \Sokil\Mongo\Client |
|
170 | + * @return Database |
|
171 | 171 | */ |
172 | 172 | public function map($name, $classDefinition = null) |
173 | 173 | { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * @param string $name name of collection |
230 | 230 | * @param array $defaultDefinition definition used when no definition found for defined class |
231 | 231 | * @throws Exception |
232 | - * @return string|array name of class or array of class definition |
|
232 | + * @return string name of class or array of class definition |
|
233 | 233 | */ |
234 | 234 | private function getCollectionDefinition($name, array $defaultDefinition = null) |
235 | 235 | { |
@@ -132,11 +132,17 @@ |
||
132 | 132 | return $this->options; |
133 | 133 | } |
134 | 134 | |
135 | + /** |
|
136 | + * @param string $name |
|
137 | + */ |
|
135 | 138 | public function getOption($name, $default = null) |
136 | 139 | { |
137 | 140 | return isset($this->options[$name]) ? $this->options[$name] : $default; |
138 | 141 | } |
139 | 142 | |
143 | + /** |
|
144 | + * @param string $name |
|
145 | + */ |
|
140 | 146 | public function hasOption($name) |
141 | 147 | { |
142 | 148 | return isset($this->options[$name]); |
@@ -30,6 +30,9 @@ discard block |
||
30 | 30 | return $this; |
31 | 31 | } |
32 | 32 | |
33 | + /** |
|
34 | + * @param string $fieldName |
|
35 | + */ |
|
33 | 36 | public function push($fieldName, $value) |
34 | 37 | { |
35 | 38 | // prepasre to store |
@@ -61,6 +64,9 @@ discard block |
||
61 | 64 | return $this; |
62 | 65 | } |
63 | 66 | |
67 | + /** |
|
68 | + * @param string $fieldName |
|
69 | + */ |
|
64 | 70 | public function pushEach($fieldName, array $values) |
65 | 71 | { |
66 | 72 | // value must be list, not dictionary |
@@ -344,6 +350,9 @@ discard block |
||
344 | 350 | return $this; |
345 | 351 | } |
346 | 352 | |
353 | + /** |
|
354 | + * @param string $operation |
|
355 | + */ |
|
347 | 356 | public function get($operation, $fieldName = null) |
348 | 357 | { |
349 | 358 | if($fieldName) { |
@@ -379,7 +388,7 @@ discard block |
||
379 | 388 | /** |
380 | 389 | * Transform operator in different formats to canonical array form |
381 | 390 | * |
382 | - * @param mixed $mixed |
|
391 | + * @param callable $mixed |
|
383 | 392 | * @return array |
384 | 393 | * @throws \Sokil\Mongo\Exception |
385 | 394 | */ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @param string $selector |
163 | 163 | * @param string|callable $className string class name or closure, which accept data and return string class name |
164 | - * @return object representation of document with class, passed as argument |
|
164 | + * @return null|Structure representation of document with class, passed as argument |
|
165 | 165 | * @throws \Sokil\Mongo\Exception |
166 | 166 | */ |
167 | 167 | public function getObject($selector, $className = '\Sokil\Mongo\Structure') |
@@ -301,6 +301,9 @@ discard block |
||
301 | 301 | return $this; |
302 | 302 | } |
303 | 303 | |
304 | + /** |
|
305 | + * @param string $selector |
|
306 | + */ |
|
304 | 307 | public function has($selector) |
305 | 308 | { |
306 | 309 | $pointer = &$this->data; |
@@ -364,6 +367,9 @@ discard block |
||
364 | 367 | return (array) $value; |
365 | 368 | } |
366 | 369 | |
370 | + /** |
|
371 | + * @param string $selector |
|
372 | + */ |
|
367 | 373 | public function unsetField($selector) |
368 | 374 | { |
369 | 375 | // modify |
@@ -432,6 +438,9 @@ discard block |
||
432 | 438 | return $this; |
433 | 439 | } |
434 | 440 | |
441 | + /** |
|
442 | + * @param string $selector |
|
443 | + */ |
|
435 | 444 | public function isModified($selector = null) |
436 | 445 | { |
437 | 446 | if(!$this->modifiedFields) { |