@@ -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; |
@@ -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 |
@@ -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); |
@@ -19,6 +19,9 @@ |
||
19 | 19 | */ |
20 | 20 | private $_collection; |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $channel |
|
24 | + */ |
|
22 | 25 | public function __construct(Database $database, $channel) |
23 | 26 | { |
24 | 27 | $this->_collection = $database |