Resolver delegating the entity resolution to a chain of resolvers.
Expanded class hierarchy of ChainEntityResolver
class ChainEntityResolver implements EntityResolverInterface {
/**
* The concrete resolvers.
*
* @var array
*/
protected $resolvers;
/**
* Constructor.
*
* @param array $resolvers
* The array of concrete resolvers.
*/
public function __construct(array $resolvers = array()) {
$this->resolvers = $resolvers;
}
/**
* Implements \Drupal\serialization\EntityResolver\EntityResolverInterface::resolve().
*/
public function resolve(NormalizerInterface $normalizer, $data, $entity_type) {
foreach ($this->resolvers as $resolver) {
if ($resolved = $resolver
->resolve($normalizer, $data, $entity_type)) {
return $resolved;
}
}
return NULL;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ChainEntityResolver:: |
protected | property | The concrete resolvers. | |
ChainEntityResolver:: |
public | function |
Implements \Drupal\serialization\EntityResolver\EntityResolverInterface::resolve(). Overrides EntityResolverInterface:: |
|
ChainEntityResolver:: |
public | function | Constructor. |