@@ -59,6 +59,9 @@ |
||
| 59 | 59 | return $this->_dql; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $dql |
|
| 64 | + */ |
|
| 62 | 65 | public function setDQL($dql) |
| 63 | 66 | { |
| 64 | 67 | $this->_dql = $dql; |
@@ -246,6 +246,9 @@ discard block |
||
| 246 | 246 | $this->clear($entity); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | + /** |
|
| 250 | + * @param string $className |
|
| 251 | + */ |
|
| 249 | 252 | public function executeInserts($className) |
| 250 | 253 | { |
| 251 | 254 | $persister = $this->getEntityPersister($className); |
@@ -262,6 +265,9 @@ discard block |
||
| 262 | 265 | $persister->executeInserts(); |
| 263 | 266 | } |
| 264 | 267 | |
| 268 | + /** |
|
| 269 | + * @param string $className |
|
| 270 | + */ |
|
| 265 | 271 | public function executeUpdates($className) |
| 266 | 272 | { |
| 267 | 273 | $persister = $this->getEntityPersister($className); |
@@ -276,6 +282,9 @@ discard block |
||
| 276 | 282 | } |
| 277 | 283 | } |
| 278 | 284 | |
| 285 | + /** |
|
| 286 | + * @param string $className |
|
| 287 | + */ |
|
| 279 | 288 | public function executeDeletions($className) |
| 280 | 289 | { |
| 281 | 290 | $persister = $this->getEntityPersister($className); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * |
| 187 | 187 | * @param object $entity The entity to delete. |
| 188 | 188 | * |
| 189 | - * @return bool TRUE if the entity got deleted in the database, FALSE otherwise. |
|
| 189 | + * @return boolean|null TRUE if the entity got deleted in the database, FALSE otherwise. |
|
| 190 | 190 | */ |
| 191 | 191 | public function delete($entity) |
| 192 | 192 | { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | * @param object $entity |
| 399 | 399 | * @param Criteria|null $extraConditions |
| 400 | 400 | * |
| 401 | - * @return boolean TRUE if the entity exists in the database, FALSE otherwise. |
|
| 401 | + * @return boolean|null TRUE if the entity exists in the database, FALSE otherwise. |
|
| 402 | 402 | */ |
| 403 | 403 | public function exists($entity, Criteria $extraConditions = null) |
| 404 | 404 | { |
@@ -53,6 +53,9 @@ discard block |
||
| 53 | 53 | /** @var WalkerHelper */ |
| 54 | 54 | private $walkerHelper; |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @param string $className |
|
| 58 | + */ |
|
| 56 | 59 | public function __construct(ElasticEntityManager $em, $className) |
| 57 | 60 | { |
| 58 | 61 | $this->className = $className; |
@@ -96,6 +99,9 @@ discard block |
||
| 96 | 99 | } |
| 97 | 100 | } |
| 98 | 101 | |
| 102 | + /** |
|
| 103 | + * @param integer $offset |
|
| 104 | + */ |
|
| 99 | 105 | public function loadAll(array $criteria = [], array $orderBy = null, $limit = null, $offset = null) |
| 100 | 106 | { |
| 101 | 107 | $type = $this->getEntityType(); |
@@ -300,6 +306,9 @@ discard block |
||
| 300 | 306 | } |
| 301 | 307 | } |
| 302 | 308 | |
| 309 | + /** |
|
| 310 | + * @param integer $limit |
|
| 311 | + */ |
|
| 303 | 312 | public function load(array $criteria, $limit = null, array $orderBy = null) |
| 304 | 313 | { |
| 305 | 314 | $results = $this->loadAll($criteria, $orderBy, $limit); |
@@ -61,16 +61,16 @@ |
||
| 61 | 61 | private function registerEventsListeners() |
| 62 | 62 | { |
| 63 | 63 | $this->getEventManager() |
| 64 | - ->addEventListener([DoctrineElasticEvents::beforeInsert, DoctrineElasticEvents::postInsert,], new InsertListener()); |
|
| 64 | + ->addEventListener([DoctrineElasticEvents::beforeInsert, DoctrineElasticEvents::postInsert, ], new InsertListener()); |
|
| 65 | 65 | |
| 66 | 66 | $this->getEventManager() |
| 67 | - ->addEventListener([DoctrineElasticEvents::beforeDelete, DoctrineElasticEvents::postDelete,], new DeleteListener()); |
|
| 67 | + ->addEventListener([DoctrineElasticEvents::beforeDelete, DoctrineElasticEvents::postDelete, ], new DeleteListener()); |
|
| 68 | 68 | |
| 69 | 69 | $this->getEventManager() |
| 70 | - ->addEventListener([DoctrineElasticEvents::beforeDelete, DoctrineElasticEvents::postDelete,], new UpdateListener()); |
|
| 70 | + ->addEventListener([DoctrineElasticEvents::beforeDelete, DoctrineElasticEvents::postDelete, ], new UpdateListener()); |
|
| 71 | 71 | |
| 72 | 72 | $this->getEventManager() |
| 73 | - ->addEventListener([DoctrineElasticEvents::beforeQuery, DoctrineElasticEvents::postQuery,], new QueryListener()); |
|
| 73 | + ->addEventListener([DoctrineElasticEvents::beforeQuery, DoctrineElasticEvents::postQuery, ], new QueryListener()); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | $baseHost = reset($hosts); |
| 41 | 41 | |
| 42 | 42 | if (empty($baseHost) |
| 43 | - || ! is_string($baseHost) |
|
| 44 | - || ! preg_match('/http/', $baseHost)) { |
|
| 43 | + || !is_string($baseHost) |
|
| 44 | + || !preg_match('/http/', $baseHost)) { |
|
| 45 | 45 | throw new ConnectionException("Elasticsearch host is invalid. "); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $queryParams = array_replace_recursive( |
| 332 | 332 | ['size' => self::DEFAULT_MAX_RESULTS], |
| 333 | - array_filter($queryParams, function ($value) { |
|
| 333 | + array_filter($queryParams, function($value) { |
|
| 334 | 334 | return $value !== null; |
| 335 | 335 | }) |
| 336 | 336 | ); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | |
| 344 | 344 | $url = "$index/$type/_search?" . http_build_query($queryParams); |
| 345 | 345 | |
| 346 | - $cleanQuery = function ($queryPart, callable $recusiveFn) { |
|
| 346 | + $cleanQuery = function($queryPart, callable $recusiveFn) { |
|
| 347 | 347 | if (!is_array($queryPart)) { |
| 348 | 348 | return $queryPart; |
| 349 | 349 | } |