Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit e82c9e8

Browse files
committed
Missing resource factory options.
1 parent 7dddd68 commit e82c9e8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/book/resource-generator.md

+27
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ following information:
5757
- string `$paginationParam = 'page'` (name of the parameter indicating the
5858
current page of results)
5959
- string `$paginationParamType = self::TYPE_QUERY` (one of "query" or "placeholder")
60+
- `Zend\Expressive\Hal\Metadata\UrlBasedResourceMetadata`
61+
- string `$class`
62+
- string `$url`
63+
- string `$extractor` (string service name of the zend-hydrator hydrator to
64+
use for extracting data from the instance)
6065

6166
We aggregate metadata in a `Zend\Expressive\Hal\Metadata\MetadataMap` instance:
6267

@@ -116,6 +121,28 @@ return [
116121
];
117122
```
118123

124+
The rest of the parameters follow underscore delimiter naming convention:
125+
126+
- `RouteBasedResourceMetadata::class`
127+
- `resource_identifier` (name of the property uniquely identifying the resource)
128+
- `route_identifier_placeholder` (name of the routing parameter that maps to the resource identifier)
129+
- `route_params` (associative array of substitutions to use with the designated route)
130+
- `RouteBasedCollectionMetadata::class`
131+
- `pagination_param` (name of the parameter indicating the current page of results)
132+
- `pagination_param_type` (one of "query" or "placeholder")
133+
- `route_params` (associative array of substitutions to use with the designated route)
134+
- `query_string_arguments` (associative array of additional routing parameters to substitute when generating the URI)
135+
- `UrlBasedResourceMetadata::class`
136+
- `resource_class`
137+
- `url`
138+
- `extractor`
139+
- `UrlBasedCollectionMetadata::class`
140+
- `collection_class`
141+
- `collection_relation`
142+
- `url`
143+
- `pagination_param` (name of the parameter indicating the current page of results)
144+
- `pagination_param_type` (one of "query" or "placeholder")
145+
119146
## ResourceGenerator
120147

121148
Once you have defined the metadata for the various objects you will represent in

0 commit comments

Comments
 (0)