@@ -97,16 +97,25 @@ |
||
| 97 | 97 | return $result; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + /** |
|
| 101 | + * @param boolean $skipExtraneous |
|
| 102 | + */ |
|
| 100 | 103 | private static function castKey($key, $params, $skipExtraneous) |
| 101 | 104 | { |
| 102 | 105 | return static::castProperty('key', $key, $params, $skipExtraneous); |
| 103 | 106 | } |
| 104 | 107 | |
| 108 | + /** |
|
| 109 | + * @param boolean $skipExtraneous |
|
| 110 | + */ |
|
| 105 | 111 | private static function castItem($value, $params, $skipExtraneous) |
| 106 | 112 | { |
| 107 | 113 | return static::castProperty('item', $value, $params, $skipExtraneous); |
| 108 | 114 | } |
| 109 | 115 | |
| 116 | + /** |
|
| 117 | + * @param string $propertyType |
|
| 118 | + */ |
|
| 110 | 119 | private static function castProperty($propertyType, $propertyValue, $params, $skipExtraneous) |
| 111 | 120 | { |
| 112 | 121 | if (isset($params[$propertyType]['type']) && $params[$propertyType]['type'] === 'schema') { |
@@ -74,6 +74,9 @@ |
||
| 74 | 74 | $this->filter = []; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $logical |
|
| 79 | + */ |
|
| 77 | 80 | protected function parseWhere($conditions, $logical) |
| 78 | 81 | { |
| 79 | 82 | $subGroup = []; |
@@ -19,8 +19,7 @@ |
||
| 19 | 19 | public function __construct(Client $client = null, $databaseName = null) |
| 20 | 20 | {
|
| 21 | 21 | $this->client = $client === null ? |
| 22 | - new Client(self::getUri(), self::getUriOptions(), self::getDriverOptions()) : |
|
| 23 | - $client; |
|
| 22 | + new Client(self::getUri(), self::getUriOptions(), self::getDriverOptions()) : $client; |
|
| 24 | 23 | $this->databaseName = $databaseName === null ? getenv('MONGODB_DATABASE') : $databaseName;
|
| 25 | 24 | } |
| 26 | 25 | |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $this->schema = $reflectionHelper->createInstance($schemaClass)->schema(); |
| 25 | 25 | $this->primaryKey = $primaryKey; |
| 26 | 26 | $this->client = $client === null ? |
| 27 | - new Client(Database::getUri(), Database::getUriOptions(), Database::getDriverOptions()) : |
|
| 28 | - $client; |
|
| 27 | + new Client(Database::getUri(), Database::getUriOptions(), Database::getDriverOptions()) : $client; |
|
| 29 | 28 | $this->databaseName = $databaseName === null ? getenv('MONGODB_DATABASE') : $databaseName; |
| 30 | 29 | $mongodb = $this->client->selectDatabase($this->databaseName); |
| 31 | 30 | $this->collection = $mongodb->selectCollection($this->resourceName); |