@@ -362,6 +362,7 @@ discard block |
||
| 362 | 362 | |
| 363 | 363 | /** |
| 364 | 364 | * Find nodes with custom filters. |
| 365 | + * @param integer $offset |
|
| 365 | 366 | */ |
| 366 | 367 | public function findNodesByFilter(array $filter, ?int $offset = null, ?int $limit = null): Generator |
| 367 | 368 | { |
@@ -551,6 +552,8 @@ discard block |
||
| 551 | 552 | |
| 552 | 553 | /** |
| 553 | 554 | * Get custom filtered children. |
| 555 | + * @param integer $offset |
|
| 556 | + * @param integer $limit |
|
| 554 | 557 | */ |
| 555 | 558 | public function findNodesByFilterUser(int $deleted, array $filter, ?int $offset = null, ?int $limit = null): Generator |
| 556 | 559 | { |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | /** |
| 419 | 419 | * Find nodes with custom filter recursive. |
| 420 | 420 | */ |
| 421 | - public function findNodesByFilterRecursiveChildren(array $parent_filter=[], int $deleted, ?int $offset = null, ?int $limit = null): Generator |
|
| 421 | + public function findNodesByFilterRecursiveChildren(array $parent_filter = [], int $deleted, ?int $offset = null, ?int $limit = null): Generator |
|
| 422 | 422 | { |
| 423 | 423 | $deleted_filter = []; |
| 424 | 424 | if (NodeInterface::DELETED_EXCLUDE === $deleted) { |
@@ -432,12 +432,12 @@ discard block |
||
| 432 | 432 | [ |
| 433 | 433 | 'acl' => ['$exists' => false], |
| 434 | 434 | ], [ |
| 435 | - 'acl.id' => (string)$this->user->getId(), |
|
| 435 | + 'acl.id' => (string) $this->user->getId(), |
|
| 436 | 436 | ] |
| 437 | 437 | ] |
| 438 | 438 | ]; |
| 439 | 439 | |
| 440 | - if(count($deleted_filter) > 0) { |
|
| 440 | + if (count($deleted_filter) > 0) { |
|
| 441 | 441 | $query = ['$and' => [$deleted_filter, $query]]; |
| 442 | 442 | } |
| 443 | 443 | |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | array_pop($query); |
| 477 | 477 | |
| 478 | 478 | $offset !== null ? $query[] = ['$skip' => $offset] : false; |
| 479 | - $limit !== null ? $query[] = ['$limit' => $limit]: false; |
|
| 479 | + $limit !== null ? $query[] = ['$limit' => $limit] : false; |
|
| 480 | 480 | $result = $this->db->storage->aggregate($query); |
| 481 | 481 | |
| 482 | 482 | foreach ($result as $node) { |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | public function getSize(): int |
| 278 | 278 | { |
| 279 | - if($this->isFiltered()) { |
|
| 279 | + if ($this->isFiltered()) { |
|
| 280 | 280 | return count($this->getChildren()); |
| 281 | 281 | } |
| 282 | 282 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $this->storage = $this->_parent->getStorage()->deleteCollection($this); |
| 370 | 370 | |
| 371 | 371 | if (!$this->isReference() && !$this->isMounted() && !$this->isFiltered()) { |
| 372 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
| 372 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
| 373 | 373 | $node->delete(false, $recursion, false); |
| 374 | 374 | }, NodeInterface::DELETED_EXCLUDE); |
| 375 | 375 | } |
@@ -864,8 +864,8 @@ discard block |
||
| 864 | 864 | [ |
| 865 | 865 | 'acl' => ['$exists' => false], |
| 866 | 866 | ], [ |
| 867 | - 'acl.id' => (string)$this->_user->getId(), |
|
| 868 | - 'acl.privilege' => ['$in' => ['m','rw','r','w','w+']] |
|
| 867 | + 'acl.id' => (string) $this->_user->getId(), |
|
| 868 | + 'acl.privilege' => ['$in' => ['m', 'rw', 'r', 'w', 'w+']] |
|
| 869 | 869 | ] |
| 870 | 870 | ] |
| 871 | 871 | ] |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | protected function _forceDelete(?string $recursion = null, bool $recursion_first = true): bool |
| 914 | 914 | { |
| 915 | 915 | if (!$this->isReference() && !$this->isMounted() && !$this->isFiltered()) { |
| 916 | - $this->doRecursiveAction(function ($node) use ($recursion) { |
|
| 916 | + $this->doRecursiveAction(function($node) use ($recursion) { |
|
| 917 | 917 | $node->delete(true, $recursion, false); |
| 918 | 918 | }, NodeInterface::DELETED_INCLUDE); |
| 919 | 919 | } |