You are here

public function EntityAPIController::__construct in Entity API 7

Overridden.

Overrides DrupalDefaultEntityController::__construct

See also

DrupalDefaultEntityController#__construct()

1 call to EntityAPIController::__construct()
EntityAPIControllerExportable::__construct in includes/entity.controller.inc
Overridden.
1 method overrides EntityAPIController::__construct()
EntityAPIControllerExportable::__construct in includes/entity.controller.inc
Overridden.

File

includes/entity.controller.inc, line 161
Provides a controller building upon the core controller but providing more features like full CRUD functionality.

Class

EntityAPIController
A controller implementing EntityAPIControllerInterface for the database.

Code

public function __construct($entityType) {
  parent::__construct($entityType);

  // If this is the bundle of another entity, set the bundle key.
  if (isset($this->entityInfo['bundle of'])) {
    $info = entity_get_info($this->entityInfo['bundle of']);
    $this->bundleKey = $info['bundle keys']['bundle'];
  }
  $this->defaultRevisionKey = !empty($this->entityInfo['entity keys']['default revision']) ? $this->entityInfo['entity keys']['default revision'] : 'default_revision';
}