function EntityDeriver::getDerivativeDefinition

Same name in this branch
  1. 11.x core/modules/rest/src/Plugin/Deriver/EntityDeriver.php \Drupal\rest\Plugin\Deriver\EntityDeriver::getDerivativeDefinition()
Same name in other branches
  1. 9 core/modules/rest/src/Plugin/Deriver/EntityDeriver.php \Drupal\rest\Plugin\Deriver\EntityDeriver::getDerivativeDefinition()
  2. 9 core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php \Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver::getDerivativeDefinition()
  3. 8.9.x core/modules/rest/src/Plugin/Deriver/EntityDeriver.php \Drupal\rest\Plugin\Deriver\EntityDeriver::getDerivativeDefinition()
  4. 8.9.x core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php \Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver::getDerivativeDefinition()
  5. 10 core/modules/rest/src/Plugin/Deriver/EntityDeriver.php \Drupal\rest\Plugin\Deriver\EntityDeriver::getDerivativeDefinition()
  6. 10 core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php \Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver::getDerivativeDefinition()

Overrides DeriverInterface::getDerivativeDefinition

File

core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php, line 76

Class

EntityDeriver
Provides data type plugins for each existing entity type and bundle.

Namespace

Drupal\Core\Entity\Plugin\DataType\Deriver

Code

public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
    if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) {
        return $this->derivatives[$derivative_id];
    }
    $this->getDerivativeDefinitions($base_plugin_definition);
    if (isset($this->derivatives[$derivative_id])) {
        return $this->derivatives[$derivative_id];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.