SqlContentEntityStorage::setEntityType

public SqlContentEntityStorage::setEntityType(EntityTypeInterface $entity_type)

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 259

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

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

Please login to continue.