function SqlContentEntityStorageSchema::__construct

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::__construct()
  2. 8.9.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::__construct()
  3. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::__construct()

Constructs a SqlContentEntityStorageSchema.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Entity\ContentEntityTypeInterface $entity_type: The entity type.

\Drupal\Core\Entity\Sql\SqlContentEntityStorage $storage: The storage of the entity type. This must be an SQL-based storage.

\Drupal\Core\Database\Connection $database: The database connection to be used.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.

File

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

Class

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

Namespace

Drupal\Core\Entity\Sql

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, ContentEntityTypeInterface $entity_type, SqlContentEntityStorage $storage, Connection $database, EntityFieldManagerInterface $entity_field_manager) {
    $this->entityTypeManager = $entity_type_manager;
    $this->storage = clone $storage;
    $this->database = $database;
    $this->entityFieldManager = $entity_field_manager;
    $this->entityType = $entity_type_manager->getActiveDefinition($entity_type->id());
    $this->fieldStorageDefinitions = $entity_field_manager->getActiveFieldStorageDefinitions($entity_type->id());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.