@@ -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 |
@@ -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); |
@@ -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]); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | /** |
| 376 | 376 | * Create document query builder |
| 377 | 377 | * |
| 378 | - * @param $callable callable|null Function to configure query builder& |
|
| 378 | + * @param callable $callable callable|null Function to configure query builder& |
|
| 379 | 379 | * @return Cursor |
| 380 | 380 | */ |
| 381 | 381 | public function find($callable = null) |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | /** |
| 461 | 461 | * Store document to pool |
| 462 | 462 | * |
| 463 | - * @param array $document |
|
| 463 | + * @param Document $document |
|
| 464 | 464 | * @return \Sokil\Mongo\Collection |
| 465 | 465 | */ |
| 466 | 466 | public function addDocumentToDocumentPool(Document $document) |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | * |
| 619 | 619 | * @param string|\MongoId $id |
| 620 | 620 | * @param callable $callable cursor callable used to configure cursor |
| 621 | - * @return \Sokil\Mongo\Document|array|null |
|
| 621 | + * @return Document |
|
| 622 | 622 | */ |
| 623 | 623 | public function getDocumentDirectly($id, $callable = null) |
| 624 | 624 | { |
@@ -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 | { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | /** |
| 155 | 155 | * Reset specified mapping |
| 156 | 156 | * |
| 157 | - * @return \Sokil\Mongo\Client |
|
| 157 | + * @return Database |
|
| 158 | 158 | */ |
| 159 | 159 | public function resetMapping() |
| 160 | 160 | { |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * [collectionName => collectionClass, ...] |
| 171 | 171 | * @param string|array|Definition|null $classDefinition if $name is string, then full class name or array |
| 172 | 172 | * with parameters, else omitted |
| 173 | - * @return \Sokil\Mongo\Client |
|
| 173 | + * @return Database |
|
| 174 | 174 | */ |
| 175 | 175 | public function map($name, $classDefinition = null) |
| 176 | 176 | { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * @param string $name name of collection |
| 233 | 233 | * @param array $defaultDefinition definition used when no definition found for defined class |
| 234 | 234 | * @throws Exception |
| 235 | - * @return string|array name of class or array of class definition |
|
| 235 | + * @return string name of class or array of class definition |
|
| 236 | 236 | */ |
| 237 | 237 | private function getCollectionDefinition($name, array $defaultDefinition = null) |
| 238 | 238 | { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | * |
| 178 | 178 | * @param string $selector |
| 179 | 179 | * @param string|callable $className string class name or closure, which accept data and return string class name |
| 180 | - * @return object representation of document with class, passed as argument |
|
| 180 | + * @return null|Structure representation of document with class, passed as argument |
|
| 181 | 181 | * @throws \Sokil\Mongo\Exception |
| 182 | 182 | */ |
| 183 | 183 | public function getObject($selector, $className = '\Sokil\Mongo\Structure') |
@@ -403,6 +403,9 @@ discard block |
||
| 403 | 403 | return (array) $value; |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | + /** |
|
| 407 | + * @param string $selector |
|
| 408 | + */ |
|
| 406 | 409 | public function unsetField($selector) |
| 407 | 410 | { |
| 408 | 411 | // modify |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | * |
| 156 | 156 | * @param string $key The key of the item to store. |
| 157 | 157 | * @param mixed $value The value of the item to store, must be serializable. |
| 158 | - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and |
|
| 158 | + * @param integer|null $ttl Optional. The TTL value of this item. If no value is sent and |
|
| 159 | 159 | * the driver supports TTL then the library may set a default value |
| 160 | 160 | * for it or let the driver take care of that. |
| 161 | 161 | * @param array $tags List of tags |