class ContentEntityType

Same name in this branch
  1. main core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType
  2. main core/lib/Drupal/Core/Entity/Attribute/ContentEntityType.php \Drupal\Core\Entity\Attribute\ContentEntityType
Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType
  2. 11.x core/lib/Drupal/Core/Entity/Attribute/ContentEntityType.php \Drupal\Core\Entity\Attribute\ContentEntityType
  3. 11.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php \Drupal\Core\Entity\Annotation\ContentEntityType
  4. 10 core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType
  5. 10 core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php \Drupal\Core\Entity\Annotation\ContentEntityType
  6. 9 core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType
  7. 9 core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php \Drupal\Core\Entity\Annotation\ContentEntityType
  8. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityType.php \Drupal\Core\Entity\ContentEntityType
  9. 8.9.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php \Drupal\Core\Entity\Annotation\ContentEntityType

Defines a content entity type annotation object.

Content Entity type plugins use an object-based annotation method, rather than an array-type annotation method (as commonly used on other annotation types). The annotation properties of content entity types are found on \Drupal\Core\Entity\ContentEntityType and are accessed using get/set methods defined in \Drupal\Core\Entity\ContentEntityTypeInterface.

Hierarchy

Expanded class hierarchy of ContentEntityType

Related topics

File

core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php, line 20

Namespace

Drupal\Core\Entity\Annotation
View source
class ContentEntityType extends EntityType {
  
  /**
   * {@inheritdoc}
   */
  // phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
  public $entity_type_class = 'Drupal\\Core\\Entity\\ContentEntityType';
  
  /**
   * {@inheritdoc}
   */
  public $group = 'content';
  
  /**
   * {@inheritdoc}
   */
  public function get() {
    $this->definition['group_label'] = new TranslatableMarkup('Content', [], [
      'context' => 'Entity type group',
    ]);
    return parent::get();
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ContentEntityType::$entity_type_class public property Overrides EntityType::$entity_type_class
ContentEntityType::$group public property Overrides EntityType::$group
ContentEntityType::get public function Overrides EntityType::get
EntityType::$group_label public property The group label.
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::getClass public function Overrides AnnotationInterface::getClass 1
Plugin::getId public function Overrides AnnotationInterface::getId
Plugin::getProvider public function Overrides AnnotationInterface::getProvider 1
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Overrides AnnotationInterface::setClass 1
Plugin::setProvider public function Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 3
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
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. 1

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