public function SqlContentEntityStorage::setEntityType in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::setEntityType()
Updates the wrapped entity type definition.
@internal Only to be used internally by Entity API. Expected to be removed by https://www.drupal.org/node/2274017.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The update entity type.
File
- core/
lib/ Drupal/ Core/ Entity/ Sql/ SqlContentEntityStorage.php, line 264 - Contains \Drupal\Core\Entity\Sql\SqlContentEntityStorage.
Class
- SqlContentEntityStorage
- A content entity database storage implementation.
Namespace
Drupal\Core\Entity\SqlCode
public function setEntityType(EntityTypeInterface $entity_type) {
if ($this->entityType
->id() == $entity_type
->id()) {
$this->entityType = $entity_type;
$this
->initTableLayout();
}
else {
throw new EntityStorageException("Unsupported entity type {$entity_type->id()}");
}
}