ContentEntityType.php

Same filename in this branch
  1. 10 core/lib/Drupal/Core/Entity/ContentEntityType.php
Same filename in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityType.php
  2. 9 core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  3. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityType.php
  4. 8.9.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  5. 11.x core/lib/Drupal/Core/Entity/ContentEntityType.php
  6. 11.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php

Namespace

Drupal\Core\Entity\Annotation

File

core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php

View source
<?php

namespace Drupal\Core\Entity\Annotation;

use Drupal\Core\StringTranslation\TranslatableMarkup;

/**
 * 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.
 *
 * @ingroup entity_api
 *
 * @Annotation
 */
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();
    }

}

Classes

Title Deprecated Summary
ContentEntityType Defines a content entity type annotation object.

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