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

Namespace

Drupal\Core\Entity

File

core/lib/Drupal/Core/Entity/ContentEntityType.php
View source
<?php

namespace Drupal\Core\Entity;


/**
 * Provides an implementation of a content entity type and its metadata.
 */
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}");
    }
  }

}

Classes

Namesort descending Description
ContentEntityType Provides an implementation of a content entity type and its metadata.