8.2.x ContentEntityType.php protected ContentEntityType::checkStorageClass($class)
8.0.x ContentEntityType.php protected ContentEntityType::checkStorageClass($class)
8.1.x ContentEntityType.php protected ContentEntityType::checkStorageClass($class)
8.3.x ContentEntityType.php protected ContentEntityType::checkStorageClass($class)

Throws

\InvalidArgumentException If the provided class does not implement \Drupal\Core\Entity\ContentEntityStorageInterface.

Overrides EntityType::checkStorageClass

See also

\Drupal\Core\Entity\ContentEntityStorageInterface

File

core/lib/Drupal/Core/Entity/ContentEntityType.php, line 37

Class

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

Namespace

Drupal\Core\Entity

Code

protected function checkStorageClass($class) {
  $required_interface = ContentEntityStorageInterface::class;
  if (!is_subclass_of($class, $required_interface)) {
    throw new \InvalidArgumentException("$class does not implement $required_interface");
  }
}