3 namespace Drupal\Core\Entity;
6 * Provides an implementation of a content entity type and its metadata.
8 class ContentEntityType extends EntityType implements ContentEntityTypeInterface {
13 public function __construct($definition) {
14 parent::__construct($definition);
16 'storage' => 'Drupal\Core\Entity\Sql\SqlContentEntityStorage',
17 'view_builder' => 'Drupal\Core\Entity\EntityViewBuilder',
24 public function getConfigDependencyKey() {
31 * @throws \InvalidArgumentException
32 * If the provided class does not implement
33 * \Drupal\Core\Entity\ContentEntityStorageInterface.
35 * @see \Drupal\Core\Entity\ContentEntityStorageInterface
37 protected function checkStorageClass($class) {
38 $required_interface = ContentEntityStorageInterface::class;
39 if (!is_subclass_of($class, $required_interface)) {
40 throw new \InvalidArgumentException("$class does not implement $required_interface");