@@ -64,6 +64,8 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Get all. |
| 67 | + * @param integer $offset |
|
| 68 | + * @param integer $limit |
|
| 67 | 69 | */ |
| 68 | 70 | public function getAll(ResourceNamespaceInterface $namespace, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 69 | 71 | { |
@@ -183,6 +185,8 @@ discard block |
||
| 183 | 185 | |
| 184 | 186 | /** |
| 185 | 187 | * Change stream. |
| 188 | + * @param integer $offset |
|
| 189 | + * @param integer $limit |
|
| 186 | 190 | */ |
| 187 | 191 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 188 | 192 | { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $that = $this; |
| 95 | 95 | |
| 96 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($namespace, $that) { |
|
| 96 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($namespace, $that) { |
|
| 97 | 97 | return $that->build($resource, $namespace); |
| 98 | 98 | }); |
| 99 | 99 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | $that = $this; |
| 206 | 206 | |
| 207 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($namespace, $that) { |
|
| 207 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($namespace, $that) { |
|
| 208 | 208 | return $that->build($resource, $namespace); |
| 209 | 209 | }, $offset, $limit, $sort); |
| 210 | 210 | } |
@@ -56,6 +56,8 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Get resources. |
| 59 | + * @param integer $offset |
|
| 60 | + * @param integer $limit |
|
| 59 | 61 | */ |
| 60 | 62 | public function getAll(?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 61 | 63 | { |
@@ -124,6 +126,8 @@ discard block |
||
| 124 | 126 | |
| 125 | 127 | /** |
| 126 | 128 | * Change stream. |
| 129 | + * @param integer $offset |
|
| 130 | + * @param integer $limit |
|
| 127 | 131 | */ |
| 128 | 132 | public function watch(?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 129 | 133 | { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | $that = $this; |
| 63 | 63 | |
| 64 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function ($resource) use ($that) { |
|
| 64 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function($resource) use ($that) { |
|
| 65 | 65 | return $that->build($resource); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $that = $this; |
| 131 | 131 | |
| 132 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, null, (function ($resource) use ($that) { |
|
| 132 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, null, (function($resource) use ($that) { |
|
| 133 | 133 | return $that->build($resource); |
| 134 | 134 | })->bindTo($this), $offset, $limit, $sort); |
| 135 | 135 | } |
@@ -157,6 +157,10 @@ discard block |
||
| 157 | 157 | }); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | + /** |
|
| 161 | + * @param integer $offset |
|
| 162 | + * @param integer $limit |
|
| 163 | + */ |
|
| 160 | 164 | public function getAll(ResourceNamespaceInterface $namespace, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 161 | 165 | { |
| 162 | 166 | $filter = [ |
@@ -296,6 +300,7 @@ discard block |
||
| 296 | 300 | |
| 297 | 301 | /** |
| 298 | 302 | * Change stream. |
| 303 | + * @param integer $query |
|
| 299 | 304 | */ |
| 300 | 305 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 301 | 306 | { |
@@ -308,6 +313,7 @@ discard block |
||
| 308 | 313 | |
| 309 | 314 | /** |
| 310 | 315 | * Build. |
| 316 | + * @param DataObjectInterface $object |
|
| 311 | 317 | */ |
| 312 | 318 | public function build(array $resource, ?DataObjectInterface $object = null): DataObjectRelationInterface |
| 313 | 319 | { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $that = $this; |
| 144 | 144 | |
| 145 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($object, $relation, $that) { |
|
| 145 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($object, $relation, $that) { |
|
| 146 | 146 | $object_1 = $resource['data']['relation'][0]; |
| 147 | 147 | $object_2 = $resource['data']['relation'][1]; |
| 148 | 148 | $related = $object_1; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $that = $this; |
| 173 | 173 | |
| 174 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($that) { |
|
| 174 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($that) { |
|
| 175 | 175 | return $that->build($resource); |
| 176 | 176 | }); |
| 177 | 177 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | { |
| 302 | 302 | $that = $this; |
| 303 | 303 | |
| 304 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($that) { |
|
| 304 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($that) { |
|
| 305 | 305 | return $that->build($resource); |
| 306 | 306 | }, $offset, $limit, $sort); |
| 307 | 307 | } |
@@ -191,6 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | 193 | * Get all. |
| 194 | + * @param Closure $build |
|
| 194 | 195 | */ |
| 195 | 196 | public function getAllFrom(Collection $collection, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null, ?Closure $build = null): Generator |
| 196 | 197 | { |
@@ -217,6 +218,7 @@ discard block |
||
| 217 | 218 | |
| 218 | 219 | /** |
| 219 | 220 | * Change stream. |
| 221 | + * @param Closure $build |
|
| 220 | 222 | */ |
| 221 | 223 | public function watchFrom(Collection $collection, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = [], ?Closure $build = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
| 222 | 224 | { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $that = $this; |
| 84 | 84 | |
| 85 | - return $this->resource_factory->getAllFrom($this->db->{$this->scheduler->getJobQueue()}, $filter, $offset, $limit, $sort, function (array $resource) use ($namespace, $that) { |
|
| 85 | + return $this->resource_factory->getAllFrom($this->db->{$this->scheduler->getJobQueue()}, $filter, $offset, $limit, $sort, function(array $resource) use ($namespace, $that) { |
|
| 86 | 86 | return $that->build($resource, $namespace); |
| 87 | 87 | }); |
| 88 | 88 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | $that = $this; |
| 142 | 142 | |
| 143 | - return $this->resource_factory->watchFrom($this->db->{$this->scheduler->getJobQueue()}, $after, $existing, $query, function (array $resource) use ($namespace, $that) { |
|
| 143 | + return $this->resource_factory->watchFrom($this->db->{$this->scheduler->getJobQueue()}, $after, $existing, $query, function(array $resource) use ($namespace, $that) { |
|
| 144 | 144 | return $that->build($resource, $namespace); |
| 145 | 145 | }, $offset, $limit, $sort); |
| 146 | 146 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | $that = $this; |
| 103 | 103 | |
| 104 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function (array $resource) use ($that) { |
|
| 104 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function(array $resource) use ($that) { |
|
| 105 | 105 | return $that->build($resource); |
| 106 | 106 | }); |
| 107 | 107 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | $that = $this; |
| 175 | 175 | |
| 176 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($that) { |
|
| 176 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($that) { |
|
| 177 | 177 | return $that->build($resource); |
| 178 | 178 | }, $offset, $limit, $sort); |
| 179 | 179 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $that = $this; |
| 73 | 73 | |
| 74 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function (array $resource) use ($that) { |
|
| 74 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function(array $resource) use ($that) { |
|
| 75 | 75 | return $that->build($resource); |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $that = $this; |
| 140 | 140 | |
| 141 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($that) { |
|
| 141 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($that) { |
|
| 142 | 142 | return $that->build($resource); |
| 143 | 143 | }, $offset, $limit, $sort); |
| 144 | 144 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $that = $this; |
| 108 | 108 | |
| 109 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($collection, $that) { |
|
| 109 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($collection, $that) { |
|
| 110 | 110 | return $that->build($resource, $collection); |
| 111 | 111 | }); |
| 112 | 112 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | $that = $this; |
| 205 | 205 | |
| 206 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($collection, $that) { |
|
| 206 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($collection, $that) { |
|
| 207 | 207 | return $that->build($resource, $collection); |
| 208 | 208 | }, $offset, $limit, $sort); |
| 209 | 209 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $that = $this; |
| 64 | 64 | |
| 65 | - return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function ($resource) use ($that) { |
|
| 65 | + return $this->resource_factory->getAllFrom($this->db->{self::COLLECTION_NAME}, $query, $offset, $limit, $sort, function($resource) use ($that) { |
|
| 66 | 66 | return $that->build($resource); |
| 67 | 67 | }); |
| 68 | 68 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $that = $this; |
| 132 | 132 | |
| 133 | - return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function ($resource) use ($that) { |
|
| 133 | + return $this->resource_factory->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function($resource) use ($that) { |
|
| 134 | 134 | return $that->build($resource); |
| 135 | 135 | }, $offset, $limit, $sort); |
| 136 | 136 | } |