ContentEntityType::checkStorageClass

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");
  }
}
doc_Drupal
2016-10-29 08:57:43
Comments
Leave a Comment

Please login to continue.