SqlContentEntityStorageSchema::checkEntityType

protected SqlContentEntityStorageSchema::checkEntityType(EntityTypeInterface $entity_type)

Checks that we are dealing with the correct entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type to be checked.

Return value

bool TRUE if the entity type matches the current one.

Throws

\Drupal\Core\Entity\EntityStorageException

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 463

Class

SqlContentEntityStorageSchema
Defines a schema handler that supports revisionable, translatable entities.

Namespace

Drupal\Core\Entity\Sql

Code

protected function checkEntityType(EntityTypeInterface $entity_type) {
  if ($entity_type->id() != $this->entityType->id()) {
    throw new EntityStorageException("Unsupported entity type {$entity_type->id()}");
  }
  return TRUE;
}
doc_Drupal
2016-10-29 09:43:35
Comments
Leave a Comment

Please login to continue.