public function EntityAPIControllerExportable::__construct in Entity API 7
Overridden.
Allows specifying a name key serving as uniform identifier for this entity type while still internally we are using numeric identifieres.
Overrides EntityAPIController::__construct
File
- includes/
entity.controller.inc, line 704 - Provides a controller building upon the core controller but providing more features like full CRUD functionality.
Class
- EntityAPIControllerExportable
- A controller implementing exportables stored in the database.
Code
public function __construct($entityType) {
parent::__construct($entityType);
// Use the name key as primary identifier.
$this->nameKey = isset($this->entityInfo['entity keys']['name']) ? $this->entityInfo['entity keys']['name'] : $this->idKey;
if (!empty($this->entityInfo['exportable'])) {
$this->statusKey = isset($this->entityInfo['entity keys']['status']) ? $this->entityInfo['entity keys']['status'] : 'status';
$this->moduleKey = isset($this->entityInfo['entity keys']['module']) ? $this->entityInfo['entity keys']['module'] : 'module';
}
}