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

Provides an implementation of a content entity type and its metadata.

Hierarchy

Expanded class hierarchy of ContentEntityType

6 files declare their use of ContentEntityType

File

core/lib/Drupal/Core/Entity/ContentEntityType.php, line 8

Namespace

Drupal\Core\Entity
View source
class ContentEntityType extends EntityType implements ContentEntityTypeInterface {

  /**
   * {@inheritdoc}
   */
  public function __construct($definition) {
    parent::__construct($definition);
    $this->handlers += array(
      'storage' => 'Drupal\Core\Entity\Sql\SqlContentEntityStorage',
      'view_builder' => 'Drupal\Core\Entity\EntityViewBuilder',
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getConfigDependencyKey() {
    return 'content';
  }

  /**
   * {@inheritdoc}
   *
   * @throws \InvalidArgumentException
   *   If the provided class does not implement
   *   \Drupal\Core\Entity\ContentEntityStorageInterface.
   *
   * @see \Drupal\Core\Entity\ContentEntityStorageInterface
   */
  protected function checkStorageClass($class) {
    $required_interface = ContentEntityStorageInterface::class;
    if (!is_subclass_of($class, $required_interface)) {
      throw new \InvalidArgumentException("$class does not implement $required_interface");
    }
  }

}

Members

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