Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions core/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class WithParameter
}
```

### Configuration Options
#### Configuration Options

The `IriConverterParameterProvider` supports the following options in `extraProperties`:

Expand Down Expand Up @@ -487,20 +487,7 @@ The provider will:
- Optionally use the `uri_template` from `extraProperties` to construct the proper operation for loading the resource
- Return the loaded entity, making it available in your state provider

#### Array Support

Both `IriConverterParameterProvider` and `ReadLinkParameterProvider` support processing arrays of values. When you pass an array of identifiers or IRIs, they will return an array of resolved entities:

```php
// For IRI converter: ?related[]=/dummies/1&related[]=/dummies/2
// For ReadLink provider: ?dummies[]=uuid1&dummies[]=uuid2
'items' => new QueryParameter(
provider: ReadLinkParameterProvider::class,
extraProperties: ['resource_class' => Dummy::class]
)
```

### ReadLinkParameterProvider Configuration Options
#### ReadLinkParameterProvider Configuration Options

You can control the behavior of `ReadLinkParameterProvider` with these `extraProperties`:

Expand All @@ -520,6 +507,19 @@ You can control the behavior of `ReadLinkParameterProvider` with these `extraPro
)
```

### Array Support

Both `IriConverterParameterProvider` and `ReadLinkParameterProvider` support processing arrays of values. When you pass an array of identifiers or IRIs, they will return an array of resolved entities:

```php
// For IRI converter: ?related[]=/dummies/1&related[]=/dummies/2
// For ReadLink provider: ?dummies[]=uuid1&dummies[]=uuid2
'items' => new QueryParameter(
provider: ReadLinkParameterProvider::class,
extraProperties: ['resource_class' => Dummy::class]
)
```

### Creating a Custom Parameter Provider

You can create your own providers to implement any custom logic. A provider must implement `ParameterProviderInterface`. The `provide` method can modify the parameter's value or even return a modified `Operation` to alter the request handling flow.
Expand Down