@@ -115,7 +115,7 @@ |
||
115 | 115 | 'namespace' => ['href' => (string) $request->getUri()->withPath('/api/v1/namespaces/'.$namespace)], |
116 | 116 | 'collection' => ['href' => (string) $request->getUri()->withPath('/api/v1/namespaces/'.$namespace.'/collections/'.$collection)], |
117 | 117 | 'endpoint' => ['href' => (string) $request->getUri()->withPath('/api/v1/namespaces/'.$namespace.'/collections/'.$collection.'/endpoints/'.$endpoint)], |
118 | - ], |
|
118 | + ], |
|
119 | 119 | 'kind' => 'Workflow', |
120 | 120 | 'namespace' => $namespace, |
121 | 121 | 'collection' => $collection, |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ]; |
80 | 80 | } |
81 | 81 | |
82 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($namespace) { |
|
82 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($namespace) { |
|
83 | 83 | return $this->build($resource, $namespace); |
84 | 84 | }); |
85 | 85 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
145 | 145 | { |
146 | - return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($namespace) { |
|
146 | + return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($namespace) { |
|
147 | 147 | return $this->build($resource, $namespace); |
148 | 148 | }, $offset, $limit, $sort); |
149 | 149 | } |
@@ -46,5 +46,5 @@ |
||
46 | 46 | /** |
47 | 47 | * Switch namespace. |
48 | 48 | */ |
49 | - public function switch(string $name): ResourceNamespaceInterface; |
|
49 | + public function switch (string $name): ResourceNamespaceInterface; |
|
50 | 50 | } |
@@ -109,7 +109,7 @@ |
||
109 | 109 | /** |
110 | 110 | * {@inheritdoc} |
111 | 111 | */ |
112 | - public function switch(string $name): ResourceNamespaceInterface |
|
112 | + public function switch (string $name): ResourceNamespaceInterface |
|
113 | 113 | { |
114 | 114 | return $this->namespace_factory->getOne($name); |
115 | 115 | } |
@@ -144,7 +144,7 @@ |
||
144 | 144 | 'data' => [ |
145 | 145 | 'schema' => $this->schema->getSchema(), |
146 | 146 | ], |
147 | - ]; |
|
147 | + ]; |
|
148 | 148 | |
149 | 149 | return AttributeResolver::resolve($request, $this, $resource); |
150 | 150 | } |
@@ -216,6 +216,10 @@ |
||
216 | 216 | |
217 | 217 | /** |
218 | 218 | * Change stream. |
219 | + * @param boolean $query |
|
220 | + * @param boolean $offset |
|
221 | + * @param boolean $limit |
|
222 | + * @param boolean $sort |
|
219 | 223 | */ |
220 | 224 | public function watch(CollectionInterface $collection, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
221 | 225 | { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getAll(CollectionInterface $collection, ?array $query = null, bool $include_dataset = true, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
119 | 119 | { |
120 | - return $this->getAllFrom($this->db->{$collection->getCollection()}, $query, $offset, $limit, $sort, function (array $resource) use ($collection) { |
|
120 | + return $this->getAllFrom($this->db->{$collection->getCollection()}, $query, $offset, $limit, $sort, function(array $resource) use ($collection) { |
|
121 | 121 | return $this->build($resource, $collection); |
122 | 122 | }); |
123 | 123 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function watch(CollectionInterface $collection, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
193 | 193 | { |
194 | - return $this->watchFrom($this->db->{$collection->getCollection()}, $after, $existing, $query, function (array $resource) use ($collection) { |
|
194 | + return $this->watchFrom($this->db->{$collection->getCollection()}, $after, $existing, $query, function(array $resource) use ($collection) { |
|
195 | 195 | return $this->build($collection, $resource); |
196 | 196 | }, $offset, $limit, $sort); |
197 | 197 | } |
@@ -131,6 +131,10 @@ discard block |
||
131 | 131 | |
132 | 132 | /** |
133 | 133 | * {@inheritdoc} |
134 | + * @param integer $query |
|
135 | + * @param integer $offset |
|
136 | + * @param integer $limit |
|
137 | + * @param integer $sort |
|
134 | 138 | */ |
135 | 139 | public function getAll(ResourceNamespaceInterface $namespace, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
136 | 140 | { |
@@ -235,6 +239,9 @@ discard block |
||
235 | 239 | |
236 | 240 | /** |
237 | 241 | * Change stream. |
242 | + * @param boolean $after |
|
243 | + * @param boolean $query |
|
244 | + * @param boolean $offset |
|
238 | 245 | */ |
239 | 246 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
240 | 247 | { |
@@ -245,6 +252,7 @@ discard block |
||
245 | 252 | |
246 | 253 | /** |
247 | 254 | * Build. |
255 | + * @param DataObjectInterface $object |
|
248 | 256 | */ |
249 | 257 | public function build(array $resource, ?DataObjectInterface $object = null): DataObjectRelationInterface |
250 | 258 | { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ]; |
115 | 115 | } |
116 | 116 | |
117 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($object, $relation) { |
|
117 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($object, $relation) { |
|
118 | 118 | $object_1 = $resource['data']['relation'][0]; |
119 | 119 | $object_2 = $resource['data']['relation'][1]; |
120 | 120 | $related = $object_1; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | ]; |
145 | 145 | } |
146 | 146 | |
147 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) { |
|
147 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) { |
|
148 | 148 | return $this->build($resource); |
149 | 149 | }); |
150 | 150 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
240 | 240 | { |
241 | - return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) { |
|
241 | + return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) { |
|
242 | 242 | return $this->build($resource); |
243 | 243 | }, $offset, $limit, $sort); |
244 | 244 | } |
@@ -409,6 +409,7 @@ |
||
409 | 409 | |
410 | 410 | /** |
411 | 411 | * Get identifier. |
412 | + * @return string |
|
412 | 413 | */ |
413 | 414 | protected function getResourceId(array $object, array $endpoint_object = []): ?string |
414 | 415 | { |
@@ -64,6 +64,10 @@ discard block |
||
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Get all. |
67 | + * @param integer $query |
|
68 | + * @param integer $offset |
|
69 | + * @param integer $limit |
|
70 | + * @param integer $sort |
|
67 | 71 | */ |
68 | 72 | public function getAll(ResourceNamespaceInterface $namespace, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
69 | 73 | { |
@@ -174,6 +178,10 @@ discard block |
||
174 | 178 | |
175 | 179 | /** |
176 | 180 | * Change stream. |
181 | + * @param boolean $query |
|
182 | + * @param boolean $offset |
|
183 | + * @param boolean $limit |
|
184 | + * @param boolean $sort |
|
177 | 185 | */ |
178 | 186 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
179 | 187 | { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ]; |
80 | 80 | } |
81 | 81 | |
82 | - return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function (array $resource) use ($namespace) { |
|
82 | + return $this->getAllFrom($this->db->{self::COLLECTION_NAME}, $filter, $offset, $limit, $sort, function(array $resource) use ($namespace) { |
|
83 | 83 | return $this->build($resource, $namespace); |
84 | 84 | }); |
85 | 85 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function watch(ResourceNamespaceInterface $namespace, ?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
145 | 145 | { |
146 | - return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function (array $resource) use ($namespace) { |
|
146 | + return $this->watchFrom($this->db->{self::COLLECTION_NAME}, $after, $existing, $query, function(array $resource) use ($namespace) { |
|
147 | 147 | return $this->build($resource, $namespace); |
148 | 148 | }, $offset, $limit, $sort); |
149 | 149 | } |