ContentEntityType::checkStorageClass

protected function 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");
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityType.php/function/ContentEntityType::checkStorageClass/8.1.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部