public function DatabaseStorageControllerNG::__construct

Overrides DatabaseStorageController::__construct().

Overrides DatabaseStorageController::__construct

1 call to DatabaseStorageControllerNG::__construct()
UserStorageController::__construct in drupal/core/modules/user/lib/Drupal/user/UserStorageController.php
Constructs a new UserStorageController object.
1 method overrides DatabaseStorageControllerNG::__construct()
UserStorageController::__construct in drupal/core/modules/user/lib/Drupal/user/UserStorageController.php
Constructs a new UserStorageController object.

File

drupal/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php, line 57
Contains \Drupal\Core\Entity\DatabaseStorageControllerNG.

Class

DatabaseStorageControllerNG
Implements Field API specific enhancements to the DatabaseStorageController class.

Namespace

Drupal\Core\Entity

Code

public function __construct($entity_type, array $entity_info, Connection $database) {
  parent::__construct($entity_type, $entity_info, $database);
  $this->bundleKey = !empty($this->entityInfo['entity_keys']['bundle']) ? $this->entityInfo['entity_keys']['bundle'] : FALSE;
  $this->entityClass = $this->entityInfo['class'];

  // Check if the entity type has a dedicated table for properties.
  if (!empty($this->entityInfo['data_table'])) {
    $this->dataTable = $this->entityInfo['data_table'];
  }

  // Work-a-round to let load() get stdClass storage records without having to
  // override it. We map storage records to entities in
  // DatabaseStorageControllerNG:: mapFromStorageRecords().
  // @todo: Remove this once this is moved in the main controller.
  unset($this->entityInfo['class']);
}