1. 8.4.x core/lib/Drupal/Core/Entity/EntityType.php EntityType
  2. 8.4.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php EntityType
  3. 8.0.x core/lib/Drupal/Core/Entity/EntityType.php EntityType
  4. 8.0.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php EntityType
  5. 8.1.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php EntityType
  6. 8.1.x core/lib/Drupal/Core/Entity/EntityType.php EntityType
  7. 8.2.x core/lib/Drupal/Core/Entity/EntityType.php EntityType
  8. 8.2.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php EntityType
  9. 8.3.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php EntityType
  10. 8.3.x core/lib/Drupal/Core/Entity/EntityType.php EntityType
  11. 8.5.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php EntityType
  12. 8.5.x core/lib/Drupal/Core/Entity/EntityType.php EntityType

Provides an implementation of an entity type and its metadata.

Hierarchy

Expanded class hierarchy of EntityType

Related topics

7 files declare their use of EntityType
ConfigEntityType.php in core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php
EntityFormTest.php in core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
EntityTypeTest.php in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
EntityViewsDataTest.php in core/modules/views/tests/src/Unit/EntityViewsDataTest.php
Contains \Drupal\Tests\views\Unit\EntityViewsDataTest.
FieldConfigEntityUnitTest.php in core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
Contains \Drupal\Tests\field\Unit\FieldConfigEntityUnitTest.

... See full list

5 string references to 'EntityType'
EntityDataDefinition::getEntityTypeId in core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
Gets the entity type ID.
EntityDataDefinition::setEntityTypeId in core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
Sets the entity type ID.
EntityReferenceItem::propertyDefinitions in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Defines field item properties.
EntityTypeConstraintValidatorTest::testValidation in core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
Tests the EntityTypeConstraintValidator.
TypedDataTest::testTypedDataValidation in core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
Tests typed data validation.

File

core/lib/Drupal/Core/Entity/EntityType.php, line 15

Namespace

Drupal\Core\Entity
View source
class EntityType implements EntityTypeInterface {

  use StringTranslationTrait;

  /**
   * Indicates whether entities should be statically cached.
   *
   * @var bool
   */
  protected $static_cache = TRUE;

  /**
   * Indicates whether the rendered output of entities should be cached.
   *
   * @var bool
   */
  protected $render_cache = TRUE;

  /**
   * Indicates if the persistent cache of field data should be used.
   *
   * @var bool
   */
  protected $persistent_cache = TRUE;

  /**
   * An array of entity keys.
   *
   * @var array
   */
  protected $entity_keys = array();

  /**
   * The unique identifier of this entity type.
   *
   * @var string
   */
  protected $id;

  /**
   * The name of the provider of this entity type.
   *
   * @var string
   */
  protected $provider;

  /**
   * The name of the entity type class.
   *
   * @var string
   */
  protected $class;

  /**
   * The name of the original entity type class.
   *
   * This is only set if the class name is changed.
   *
   * @var string
   */
  protected $originalClass;

  /**
   * An array of handlers.
   *
   * @var array
   */
  protected $handlers = array();

  /**
   * The name of the default administrative permission.
   *
   * @var string
   */
  protected $admin_permission;

  /**
   * The permission granularity level.
   *
   * The allowed values are respectively "entity_type" or "bundle".
   *
   * @var string
   */
  protected $permission_granularity = 'entity_type';
  /**
   * Link templates using the URI template syntax.
   *
   * @var array
   */
  protected $links = array();

  /**
   * The name of a callback that returns the label of the entity.
   *
   * @var callable|null
   *
   * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
   *   Use Drupal\Core\Entity\EntityInterface::label() for complex label
   *   generation as needed.
   *
   * @see \Drupal\Core\Entity\EntityInterface::label()
   *
   * @todo Remove usages of label_callback https://www.drupal.org/node/2450793.
   */
  protected $label_callback = NULL;

  /**
   * The name of the entity type which provides bundles.
   *
   * @var string
   */
  protected $bundle_entity_type = NULL;

  /**
   * The name of the entity type for which bundles are provided.
   *
   * @var string|null
   */
  protected $bundle_of = NULL;

  /**
   * The human-readable name of the entity bundles, e.g. Vocabulary.
   *
   * @var string|null
   */
  protected $bundle_label = NULL;

  /**
   * The name of the entity type's base table.
   *
   * @var string|null
   */
  protected $base_table = NULL;

  /**
   * The name of the entity type's revision data table.
   *
   * @var string|null
   */
  protected $revision_data_table = NULL;

  /**
   * The name of the entity type's revision table.
   *
   * @var string|null
   */
  protected $revision_table = NULL;

  /**
   * The name of the entity type's data table.
   *
   * @var string|null
   */
  protected $data_table = NULL;

  /**
   * Indicates whether entities of this type have multilingual support.
   *
   * @var bool
   */
  protected $translatable = FALSE;

  /**
   * The human-readable name of the type.
   *
   * @var string
   */
  protected $label = '';

  /**
   * The indefinite singular name of the type.
   *
   * @var string
   */
  protected $label_singular = '';

  /**
   * The indefinite plural name of the type.
   *
   * @var string
   */
  protected $label_plural = '';

  /**
   * A definite singular/plural name of the type.
   *
   * Needed keys: "singular" and "plural".
   *
   * @var string[]
   */
  protected $label_count = [];

  /**
   * A callable that can be used to provide the entity URI.
   *
   * @var callable|null
   */
  protected $uri_callback = NULL;

  /**
   * The machine name of the entity type group.
   */
  protected $group;

  /**
   * The human-readable name of the entity type group.
   */
  protected $group_label;

  /**
   * The route name used by field UI to attach its management pages.
   *
   * @var string
   */
  protected $field_ui_base_route;

  /**
   * Indicates whether this entity type is commonly used as a reference target.
   *
   * This is used by the Entity reference field to promote an entity type in the
   * add new field select list in Field UI.
   *
   * @var bool
   */
  protected $common_reference_target = FALSE;

  /**
   * The list cache contexts for this entity type.
   *
   * @var string[]
   */
  protected $list_cache_contexts = [];

  /**
   * The list cache tags for this entity type.
   *
   * @var string[]
   */
  protected $list_cache_tags = [];

  /**
   * Entity constraint definitions.
   *
   * @var array[]
   */
  protected $constraints = array();

  /**
   * Any additional properties and values.
   *
   * @var array
   */
  protected $additional = [];

  /**
   * Constructs a new EntityType.
   *
   * @param array $definition
   *   An array of values from the annotation.
   *
   * @throws \Drupal\Core\Entity\Exception\EntityTypeIdLengthException
   *   Thrown when attempting to instantiate an entity type with too long ID.
   */
  public function __construct($definition) {
    // Throw an exception if the entity type ID is longer than 32 characters.
    if (Unicode::strlen($definition['id']) > static::ID_MAX_LENGTH) {
      throw new EntityTypeIdLengthException('Attempt to create an entity type with an ID longer than ' . static::ID_MAX_LENGTH . " characters: {$definition['id']}.");
    }

    foreach ($definition as $property => $value) {
      $this->set($property, $value);
    }

    // Ensure defaults.
    $this->entity_keys += array(
      'revision' => '',
      'bundle' => '',
      'langcode' => '',
      'default_langcode' => 'default_langcode',
    );
    $this->handlers += array(
      'access' => 'Drupal\Core\Entity\EntityAccessControlHandler',
    );
    if (isset($this->handlers['storage'])) {
      $this->checkStorageClass($this->handlers['storage']);
    }

    // Automatically add the EntityChanged constraint if the entity type tracks
    // the changed time.
    if ($this->isSubclassOf('Drupal\Core\Entity\EntityChangedInterface')) {
      $this->addConstraint('EntityChanged');
    }

    // Ensure a default list cache tag is set.
    if (empty($this->list_cache_tags)) {
      $this->list_cache_tags = [$definition['id'] . '_list'];
    }
  }

  /**
   * {@inheritdoc}
   */
  public function get($property) {
    if (property_exists($this, $property)) {
      $value = isset($this->{$property}) ? $this->{$property} : NULL;
    }
    else {
      $value = isset($this->additional[$property]) ? $this->additional[$property] : NULL;
    }
    return $value;
  }

  /**
   * {@inheritdoc}
   */
  public function set($property, $value) {
    if (property_exists($this, $property)) {
      $this->{$property} = $value;
    }
    else {
      $this->additional[$property] = $value;
    }
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function isStaticallyCacheable() {
    return $this->static_cache;
  }

  /**
   * {@inheritdoc}
   */
  public function isRenderCacheable() {
    return $this->render_cache;
  }

  /**
   * {@inheritdoc}
   */
  public function isPersistentlyCacheable() {
    return $this->persistent_cache;
  }

  /**
   * {@inheritdoc}
   */
  public function getKeys() {
    return $this->entity_keys;
  }

  /**
   * {@inheritdoc}
   */
  public function getKey($key) {
    $keys = $this->getKeys();
    return isset($keys[$key]) ? $keys[$key] : FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function hasKey($key) {
    $keys = $this->getKeys();
    return !empty($keys[$key]);
  }

  /**
   * {@inheritdoc}
   */
  public function id() {
    return $this->id;
  }

  /**
   * {@inheritdoc}
   */
  public function getProvider() {
    return $this->provider;
  }

  /**
   * {@inheritdoc}
   */
  public function getClass() {
    return $this->class;
  }

  /**
   * {@inheritdoc}
   */
  public function getOriginalClass() {
    return $this->originalClass ? : $this->class;
  }

  /**
   * {@inheritdoc}
   */
  public function setClass($class) {
    if (!$this->originalClass && $this->class) {
      // If the original class is currently not set, set it to the current
      // class, assume that is the original class name.
      $this->originalClass = $this->class;
    }
    $this->class = $class;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function isSubclassOf($class) {
    return is_subclass_of($this->getClass(), $class);
  }

  /**
   * {@inheritdoc}
   */
  public function getHandlerClasses() {
    return $this->handlers;
  }

  /**
   * {@inheritdoc}
   */
  public function getHandlerClass($handler_type, $nested = FALSE) {
    if ($this->hasHandlerClass($handler_type, $nested)) {
      $handlers = $this->getHandlerClasses();
      return $nested ? $handlers[$handler_type][$nested] : $handlers[$handler_type];
    }
  }

  /**
   * {@inheritdoc}
   */
  public function setHandlerClass($handler_type, $value) {
    $this->handlers[$handler_type] = $value;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function hasHandlerClass($handler_type, $nested = FALSE) {
    $handlers = $this->getHandlerClasses();
    if (!isset($handlers[$handler_type]) || ($nested && !isset($handlers[$handler_type][$nested]))) {
      return FALSE;
    }
    $handler = $handlers[$handler_type];
    if ($nested) {
      $handler = $handler[$nested];
    }
    return class_exists($handler);
  }

  /**
   * {@inheritdoc}
   */
  public function getStorageClass() {
    return $this->getHandlerClass('storage');
  }

  /**
   * {@inheritdoc}
   */
  public function setStorageClass($class) {
    $this->checkStorageClass($class);
    $this->handlers['storage'] = $class;
    return $this;
  }

  /**
   * Checks that the provided class is compatible with the current entity type.
   *
   * @param string $class
   *   The class to check.
   */
  protected function checkStorageClass($class) {
    // Nothing to check by default.
  }

  /**
   * {@inheritdoc}
   */
  public function getFormClass($operation) {
    return $this->getHandlerClass('form', $operation);
  }

  /**
   * {@inheritdoc}
   */
  public function setFormClass($operation, $class) {
    $this->handlers['form'][$operation] = $class;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function hasFormClasses() {
    return !empty($this->handlers['form']);
  }

  /**
   * {@inheritdoc}
   */
  public function hasRouteProviders() {
    return !empty($this->handlers['route_provider']);
  }

  /**
   * {@inheritdoc}
   */
  public function getListBuilderClass() {
    return $this->getHandlerClass('list_builder');
  }

  /**
   * {@inheritdoc}
   */
  public function setListBuilderClass($class) {
    $this->handlers['list_builder'] = $class;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function hasListBuilderClass() {
    return $this->hasHandlerClass('list_builder');
  }

  /**
   * {@inheritdoc}
   */
  public function getViewBuilderClass() {
    return $this->getHandlerClass('view_builder');
  }

  /**
   * {@inheritdoc}
   */
  public function setViewBuilderClass($class) {
    $this->handlers['view_builder'] = $class;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function hasViewBuilderClass() {
    return $this->hasHandlerClass('view_builder');
  }

  /**
   * {@inheritdoc}
   */
  public function getRouteProviderClasses() {
    return !empty($this->handlers['route_provider']) ? $this->handlers['route_provider'] : [];
  }

  /**
   * {@inheritdoc}
   */
  public function getAccessControlClass() {
    return $this->getHandlerClass('access');
  }

  /**
   * {@inheritdoc}
   */
  public function setAccessClass($class) {
    $this->handlers['access'] = $class;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getAdminPermission() {
    return $this->admin_permission ? : FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getPermissionGranularity() {
    return $this->permission_granularity;
  }

  /**
   * {@inheritdoc}
   */
  public function getLinkTemplates() {
    return $this->links;
  }

  /**
   * {@inheritdoc}
   */
  public function getLinkTemplate($key) {
    $links = $this->getLinkTemplates();
    return isset($links[$key]) ? $links[$key] : FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function hasLinkTemplate($key) {
    $links = $this->getLinkTemplates();
    return isset($links[$key]);
  }

  /**
   * {@inheritdoc}
   */
  public function setLinkTemplate($key, $path) {
    if ($path[0] !== '/') {
      throw new \InvalidArgumentException('Link templates accepts paths, which have to start with a leading slash.');
    }

    $this->links[$key] = $path;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getLabelCallback() {
    return $this->label_callback;
  }

  /**
   * {@inheritdoc}
   */
  public function setLabelCallback($callback) {
    $this->label_callback = $callback;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function hasLabelCallback() {
    return isset($this->label_callback);
  }

  /**
   * {@inheritdoc}
   */
  public function getBundleEntityType() {
    return $this->bundle_entity_type;
  }

  /**
   * {@inheritdoc}
   */
  public function getBundleOf() {
    return $this->bundle_of;
  }

  /**
   * {@inheritdoc}
   */
  public function getBundleLabel() {
    return (string) $this->bundle_label;
  }

  /**
   * {@inheritdoc}
   */
  public function getBaseTable() {
    return $this->base_table;
  }

  /**
   * {@inheritdoc}
   */
  public function isTranslatable() {
    return !empty($this->translatable);
  }

  /**
   * {@inheritdoc}
   */
  public function isRevisionable() {
    // Entity types are revisionable if a revision key has been specified.
    return $this->hasKey('revision');
  }

  /**
   * {@inheritdoc}
   */
  public function getRevisionDataTable() {
    return $this->revision_data_table;
  }

  /**
   * {@inheritdoc}
   */
  public function getRevisionTable() {
    return $this->revision_table;
  }

  /**
   * {@inheritdoc}
   */
  public function getDataTable() {
    return $this->data_table;
  }

  /**
   * {@inheritdoc}
   */
  public function getLabel() {
    return $this->label;
  }

  /**
   * {@inheritdoc}
   */
  public function getLowercaseLabel() {
    return Unicode::strtolower($this->getLabel());
  }

  /**
   * {@inheritdoc}
   */
  public function getSingularLabel() {
    if (empty($this->label_singular)) {
      $lowercase_label = $this->getLowercaseLabel();
      $this->label_singular = $lowercase_label;
    }
    return $this->label_singular;
  }

  /**
   * {@inheritdoc}
   */
  public function getPluralLabel() {
    if (empty($this->label_plural)) {
      $lowercase_label = $this->getLowercaseLabel();
      $this->label_plural = new TranslatableMarkup('@label entities', ['@label' => $lowercase_label], [], $this->getStringTranslation());
    }
    return $this->label_plural;
  }

  /**
   * {@inheritdoc}
   */
  public function getCountLabel($count) {
    if (empty($this->label_count)) {
      return $this->formatPlural($count, '@count @label', '@count @label entities', ['@label' => $this->getLowercaseLabel()], ['context' => 'Entity type label']);
    }
    $context = isset($this->label_count['context']) ? $this->label_count['context'] : 'Entity type label';
    return $this->formatPlural($count, $this->label_count['singular'], $this->label_count['plural'], ['context' => $context]);
  }

  /**
   * {@inheritdoc}
   */
  public function getUriCallback() {
    return $this->uri_callback;
  }

  /**
   * {@inheritdoc}
   */
  public function setUriCallback($callback) {
    $this->uri_callback = $callback;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getGroup() {
    return $this->group;
  }


  /**
   * {@inheritdoc}
   */
  public function getGroupLabel() {
    return !empty($this->group_label) ? $this->group_label : $this->t('Other', array(), array('context' => 'Entity type group'));
  }

  /**
   * {@inheritdoc}
   */
  public function getListCacheContexts() {
    return $this->list_cache_contexts;
  }

  /**
   * {@inheritdoc}
   */
  public function getListCacheTags() {
    return $this->list_cache_tags;
  }

  /**
   * {@inheritdoc}
   */
  public function getConfigDependencyKey() {
    // Return 'content' for the default implementation as important distinction
    // is that dependencies on other configuration entities are hard
    // dependencies and have to exist before creating the dependent entity.
    return 'content';
  }

  /**
   * {@inheritdoc}
   */
  public function isCommonReferenceTarget() {
    return $this->common_reference_target;
  }

  /**
   * {@inheritdoc}
   */
  public function getConstraints() {
    return $this->constraints;
  }

  /**
   * {@inheritdoc}
   */
  public function setConstraints(array $constraints) {
    $this->constraints = $constraints;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function addConstraint($constraint_name, $options = NULL) {
    $this->constraints[$constraint_name] = $options;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getBundleConfigDependency($bundle) {
    // If this entity type uses entities to manage its bundles then depend on
    // the bundle entity.
    if ($bundle_entity_type_id = $this->getBundleEntityType()) {
      if (!$bundle_entity = \Drupal::entityManager()->getStorage($bundle_entity_type_id)->load($bundle)) {
        throw new \LogicException(sprintf('Missing bundle entity, entity type %s, entity id %s.', $bundle_entity_type_id, $bundle));
      }
      $config_dependency = [
        'type' => 'config',
        'name' => $bundle_entity->getConfigDependencyName(),
      ];
    }
    else {
      // Depend on the provider of the entity type.
      $config_dependency = [
        'type' => 'module',
        'name' => $this->getProvider(),
      ];
    }

    return $config_dependency;
  }

}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description Overrides
EntityType::$additional protected property Any additional properties and values.
EntityType::$admin_permission protected property The name of the default administrative permission.
EntityType::$base_table protected property The name of the entity type's base table.
EntityType::$bundle_entity_type protected property The name of the entity type which provides bundles.
EntityType::$bundle_label protected property The human-readable name of the entity bundles, e.g. Vocabulary.
EntityType::$bundle_of protected property The name of the entity type for which bundles are provided.
EntityType::$class protected property The name of the entity type class.
EntityType::$common_reference_target protected property Indicates whether this entity type is commonly used as a reference target.
EntityType::$constraints protected property Entity constraint definitions.
EntityType::$data_table protected property The name of the entity type's data table.
EntityType::$entity_keys protected property An array of entity keys.
EntityType::$field_ui_base_route protected property The route name used by field UI to attach its management pages.
EntityType::$group protected property The machine name of the entity type group.
EntityType::$group_label protected property The human-readable name of the entity type group.
EntityType::$handlers protected property An array of handlers.
EntityType::$id protected property The unique identifier of this entity type.
EntityType::$label protected property The human-readable name of the type.
EntityType::$label_callback Deprecated protected property The name of a callback that returns the label of the entity.
EntityType::$label_count protected property A definite singular/plural name of the type.
EntityType::$label_plural protected property The indefinite plural name of the type.
EntityType::$label_singular protected property The indefinite singular name of the type.
EntityType::$links protected property Link templates using the URI template syntax.
EntityType::$list_cache_contexts protected property The list cache contexts for this entity type.
EntityType::$list_cache_tags protected property The list cache tags for this entity type.
EntityType::$originalClass protected property The name of the original entity type class.
EntityType::$permission_granularity protected property The permission granularity level.
EntityType::$persistent_cache protected property Indicates if the persistent cache of field data should be used.
EntityType::$provider protected property The name of the provider of this entity type.
EntityType::$render_cache protected property Indicates whether the rendered output of entities should be cached.
EntityType::$revision_data_table protected property The name of the entity type's revision data table.
EntityType::$revision_table protected property The name of the entity type's revision table.
EntityType::$static_cache protected property Indicates whether entities should be statically cached. 1
EntityType::$translatable protected property Indicates whether entities of this type have multilingual support.
EntityType::$uri_callback protected property A callable that can be used to provide the entity URI.
EntityType::addConstraint public function Adds a validation constraint. Overrides EntityTypeInterface::addConstraint
EntityType::checkStorageClass protected function Checks that the provided class is compatible with the current entity type. 2
EntityType::get public function Gets any arbitrary property. Overrides EntityTypeInterface::get
EntityType::getAccessControlClass public function Gets the access control class. Overrides EntityTypeInterface::getAccessControlClass
EntityType::getAdminPermission public function Gets the name of the default administrative permission. Overrides EntityTypeInterface::getAdminPermission
EntityType::getBaseTable public function Gets the name of the entity's base table. Overrides EntityTypeInterface::getBaseTable 1
EntityType::getBundleConfigDependency public function Gets the config dependency info for this entity, if any exists. Overrides EntityTypeInterface::getBundleConfigDependency
EntityType::getBundleEntityType public function Gets the name of the entity type which provides bundles. Overrides EntityTypeInterface::getBundleEntityType
EntityType::getBundleLabel public function Gets the label for the bundle. Overrides EntityTypeInterface::getBundleLabel
EntityType::getBundleOf public function Gets the entity type for which this entity provides bundles. Overrides EntityTypeInterface::getBundleOf
EntityType::getClass public function Gets the class. Overrides PluginDefinitionInterface::getClass
EntityType::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityTypeInterface::getConfigDependencyKey 2
EntityType::getConstraints public function Gets an array of validation constraints. Overrides EntityTypeInterface::getConstraints
EntityType::getCountLabel public function Gets the count label of the entity type Overrides EntityTypeInterface::getCountLabel
EntityType::getDataTable public function Gets the name of the entity's data table. Overrides EntityTypeInterface::getDataTable 1
EntityType::getFormClass public function Gets the form class for a specific operation. Overrides EntityTypeInterface::getFormClass
EntityType::getGroup public function Gets the machine name of the entity type group. Overrides EntityTypeInterface::getGroup
EntityType::getGroupLabel public function Gets the human-readable name of the entity type group. Overrides EntityTypeInterface::getGroupLabel
EntityType::getHandlerClass public function Overrides EntityTypeInterface::getHandlerClass
EntityType::getHandlerClasses public function Gets an array of handlers. Overrides EntityTypeInterface::getHandlerClasses
EntityType::getKey public function Gets a specific entity key. Overrides EntityTypeInterface::getKey
EntityType::getKeys public function Gets an array of entity keys. Overrides EntityTypeInterface::getKeys
EntityType::getLabel public function Gets the human-readable name of the entity type. Overrides EntityTypeInterface::getLabel
EntityType::getLabelCallback public function Gets the callback for the label of the entity. Overrides EntityTypeInterface::getLabelCallback
EntityType::getLinkTemplate public function Gets the link template for a given key. Overrides EntityTypeInterface::getLinkTemplate
EntityType::getLinkTemplates public function Gets the link templates using the URI template syntax. Overrides EntityTypeInterface::getLinkTemplates
EntityType::getListBuilderClass public function Gets the list class. Overrides EntityTypeInterface::getListBuilderClass
EntityType::getListCacheContexts public function The list cache contexts associated with this entity type. Overrides EntityTypeInterface::getListCacheContexts
EntityType::getListCacheTags public function The list cache tags associated with this entity type. Overrides EntityTypeInterface::getListCacheTags
EntityType::getLowercaseLabel public function Gets the lowercase form of the human-readable entity type name. Overrides EntityTypeInterface::getLowercaseLabel
EntityType::getOriginalClass public function Gets the name of the original entity type class. Overrides EntityTypeInterface::getOriginalClass
EntityType::getPermissionGranularity public function Gets the permission granularity level. Overrides EntityTypeInterface::getPermissionGranularity
EntityType::getPluralLabel public function Gets the plural label of the entity type. Overrides EntityTypeInterface::getPluralLabel
EntityType::getProvider public function Gets the name of the provider of this entity type. Overrides EntityTypeInterface::getProvider
EntityType::getRevisionDataTable public function Gets the name of the entity's revision data table. Overrides EntityTypeInterface::getRevisionDataTable 1
EntityType::getRevisionTable public function Gets the name of the entity's revision table. Overrides EntityTypeInterface::getRevisionTable 1
EntityType::getRouteProviderClasses public function Gets all the route provide handlers. Overrides EntityTypeInterface::getRouteProviderClasses
EntityType::getSingularLabel public function Gets the singular label of the entity type. Overrides EntityTypeInterface::getSingularLabel
EntityType::getStorageClass public function Gets the storage class. Overrides EntityTypeInterface::getStorageClass
EntityType::getUriCallback public function Gets a callable that can be used to provide the entity URI. Overrides EntityTypeInterface::getUriCallback
EntityType::getViewBuilderClass public function Gets the view builder class. Overrides EntityTypeInterface::getViewBuilderClass
EntityType::hasFormClasses public function Indicates if this entity type has any forms. Overrides EntityTypeInterface::hasFormClasses
EntityType::hasHandlerClass public function Determines if there is a handler for a given type. Overrides EntityTypeInterface::hasHandlerClass
EntityType::hasKey public function Indicates if a given entity key exists. Overrides EntityTypeInterface::hasKey
EntityType::hasLabelCallback public function Indicates if a label callback exists. Overrides EntityTypeInterface::hasLabelCallback
EntityType::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityTypeInterface::hasLinkTemplate
EntityType::hasListBuilderClass public function Indicates if this entity type has a list class. Overrides EntityTypeInterface::hasListBuilderClass
EntityType::hasRouteProviders public function Indicates if this entity type has any route provider. Overrides EntityTypeInterface::hasRouteProviders
EntityType::hasViewBuilderClass public function Indicates if this entity type has a view builder. Overrides EntityTypeInterface::hasViewBuilderClass
EntityType::id public function Gets the unique identifier of the entity type. Overrides EntityTypeInterface::id
EntityType::isCommonReferenceTarget public function Indicates whether this entity type is commonly used as a reference target. Overrides EntityTypeInterface::isCommonReferenceTarget
EntityType::isPersistentlyCacheable public function Indicates if the persistent cache of field data should be used. Overrides EntityTypeInterface::isPersistentlyCacheable
EntityType::isRenderCacheable public function Indicates whether the rendered output of entities should be cached. Overrides EntityTypeInterface::isRenderCacheable
EntityType::isRevisionable public function Indicates whether entities of this type have revision support. Overrides EntityTypeInterface::isRevisionable
EntityType::isStaticallyCacheable public function Indicates whether entities should be statically cached. Overrides EntityTypeInterface::isStaticallyCacheable
EntityType::isSubclassOf public function Indicates if the entity type is a subclass of the given class or interface. Overrides EntityTypeInterface::isSubclassOf
EntityType::isTranslatable public function Indicates whether entities of this type have multilingual support. Overrides EntityTypeInterface::isTranslatable
EntityType::set public function Sets a value to an arbitrary property. Overrides EntityTypeInterface::set
EntityType::setAccessClass public function Gets the access class. Overrides EntityTypeInterface::setAccessClass
EntityType::setClass public function Sets the class. Overrides PluginDefinitionInterface::setClass
EntityType::setConstraints public function Sets the array of validation constraints for the FieldItemList. Overrides EntityTypeInterface::setConstraints
EntityType::setFormClass public function Sets a form class for a specific operation. Overrides EntityTypeInterface::setFormClass
EntityType::setHandlerClass public function Sets the handlers for a given type. Overrides EntityTypeInterface::setHandlerClass
EntityType::setLabelCallback public function Sets the label callback. Overrides EntityTypeInterface::setLabelCallback
EntityType::setLinkTemplate public function Sets a single link template. Overrides EntityTypeInterface::setLinkTemplate
EntityType::setListBuilderClass public function Sets the list class. Overrides EntityTypeInterface::setListBuilderClass
EntityType::setStorageClass public function Sets the storage class. Overrides EntityTypeInterface::setStorageClass
EntityType::setUriCallback public function Sets a callable to use to provide the entity URI. Overrides EntityTypeInterface::setUriCallback
EntityType::setViewBuilderClass public function Gets the view builder class. Overrides EntityTypeInterface::setViewBuilderClass
EntityType::__construct public function Constructs a new EntityType. 2
EntityTypeInterface::BUNDLE_MAX_LENGTH constant The maximum length of bundle name, in characters. Overrides EntityTypeInterface::BUNDLE_MAX_LENGTH 1
EntityTypeInterface::ID_MAX_LENGTH constant The maximum length of ID, in characters. Overrides EntityTypeInterface::ID_MAX_LENGTH 1
StringTranslationTrait::$stringTranslation protected property The string translation service.
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language. 2