1. 8.4.x core/lib/Drupal/Core/Entity/ContentEntityType.php
  2. 8.4.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  3. 8.0.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  4. 8.0.x core/lib/Drupal/Core/Entity/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/ContentEntityType.php
  8. 8.2.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  9. 8.3.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  10. 8.3.x core/lib/Drupal/Core/Entity/ContentEntityType.php
  11. 8.5.x core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
  12. 8.5.x core/lib/Drupal/Core/Entity/ContentEntityType.php

Namespace

Drupal\Core\Entity

File

core/lib/Drupal/Core/Entity/ContentEntityType.php
View source
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Provides an implementation of a content entity type and its metadata.
  5. */
  6. class ContentEntityType extends EntityType implements ContentEntityTypeInterface {
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function __construct($definition) {
  11. parent::__construct($definition);
  12. $this->handlers += array(
  13. 'storage' => 'Drupal\Core\Entity\Sql\SqlContentEntityStorage',
  14. 'view_builder' => 'Drupal\Core\Entity\EntityViewBuilder',
  15. );
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function getConfigDependencyKey() {
  21. return 'content';
  22. }
  23. /**
  24. * {@inheritdoc}
  25. *
  26. * @throws \InvalidArgumentException
  27. * If the provided class does not implement
  28. * \Drupal\Core\Entity\ContentEntityStorageInterface.
  29. *
  30. * @see \Drupal\Core\Entity\ContentEntityStorageInterface
  31. */
  32. protected function checkStorageClass($class) {
  33. $required_interface = ContentEntityStorageInterface::class;
  34. if (!is_subclass_of($class, $required_interface)) {
  35. throw new \InvalidArgumentException("$class does not implement $required_interface");
  36. }
  37. }
  38. }

Classes

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