Constructs a DatabaseStorageController object.
string $entity_type: The entity type for which the instance is created.
array $entity_info: An array of entity info for the entity type.
\Drupal\Core\Database\Connection $database: The database connection to be used.
Overrides EntityStorageControllerBase::__construct
public function __construct($entity_type, array $entity_info, Connection $database) {
parent::__construct($entity_type, $entity_info);
$this->database = $database;
// Check if the entity type supports IDs.
if (isset($this->entityInfo['entity_keys']['id'])) {
$this->idKey = $this->entityInfo['entity_keys']['id'];
}
else {
$this->idKey = FALSE;
}
// Check if the entity type supports UUIDs.
if (!empty($this->entityInfo['entity_keys']['uuid'])) {
$this->uuidKey = $this->entityInfo['entity_keys']['uuid'];
}
else {
$this->uuidKey = FALSE;
}
// Check if the entity type supports revisions.
if (!empty($this->entityInfo['entity_keys']['revision'])) {
$this->revisionKey = $this->entityInfo['entity_keys']['revision'];
$this->revisionTable = $this->entityInfo['revision_table'];
}
else {
$this->revisionKey = FALSE;
}
}