Provides a resource plugin definition for every entity type.
Expanded class hierarchy of EntityDerivative
class EntityDerivative implements DerivativeInterface {
/**
* List of derivative definitions.
*
* @var array
*/
protected $derivatives;
/**
* Implements DerivativeInterface::getDerivativeDefinition().
*/
public function getDerivativeDefinition($derivative_id, array $base_plugin_definition) {
if (!isset($this->derivatives)) {
$this
->getDerivativeDefinitions($base_plugin_definition);
}
if (isset($this->derivatives[$derivative_id])) {
return $this->derivatives[$derivative_id];
}
}
/**
* Implements DerivativeInterface::getDerivativeDefinitions().
*/
public function getDerivativeDefinitions(array $base_plugin_definition) {
if (!isset($this->derivatives)) {
// Add in the default plugin configuration and the resource type.
foreach (entity_get_info() as $entity_type => $entity_info) {
$this->derivatives[$entity_type] = array(
'id' => 'entity:' . $entity_type,
'entity_type' => $entity_type,
'label' => $entity_info['label'],
);
$this->derivatives[$entity_type] += $base_plugin_definition;
}
}
return $this->derivatives;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDerivative:: |
protected | property | List of derivative definitions. | |
EntityDerivative:: |
public | function |
Implements DerivativeInterface::getDerivativeDefinition(). Overrides DerivativeInterface:: |
|
EntityDerivative:: |
public | function |
Implements DerivativeInterface::getDerivativeDefinitions(). Overrides DerivativeInterface:: |