function EntityTypeManager::processDefinition

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::processDefinition()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::processDefinition()
  3. 10 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::processDefinition()

Overrides DefaultPluginManager::processDefinition

1 call to EntityTypeManager::processDefinition()
EntityTypeManager::findDefinitions in core/lib/Drupal/Core/Entity/EntityTypeManager.php
Finds plugin definitions.

File

core/lib/Drupal/Core/Entity/EntityTypeManager.php, line 99

Class

EntityTypeManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

public function processDefinition(&$definition, $plugin_id) {
    
    /** @var \Drupal\Core\Entity\EntityTypeInterface $definition */
    parent::processDefinition($definition, $plugin_id);
    // All link templates must have a leading slash.
    foreach ((array) $definition->getLinkTemplates() as $link_relation_name => $link_template) {
        if ($link_template[0] != '/') {
            throw new InvalidLinkTemplateException("Link template '{$link_relation_name}' for entity type '{$plugin_id}' must start with a leading slash, the current link template is '{$link_template}'");
        }
    }
}

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