public function SearchApiEntityDataSourceController::__construct in Search API 7
Constructs an SearchApiDataSourceControllerInterface object.
Parameters
string $type: The item type for which this controller is created.
Overrides SearchApiAbstractDataSourceController::__construct
File
- includes/
datasource_entity.inc, line 44 - Contains the SearchApiEntityDataSourceController class.
Class
- SearchApiEntityDataSourceController
- Represents a datasource for all entities known to the Entity API.
Code
public function __construct($type) {
parent::__construct($type);
$this->entityInfo = entity_get_info($this->entityType);
if (!empty($this->entityInfo['entity keys']['id'])) {
$this->idKey = $this->entityInfo['entity keys']['id'];
}
if (!empty($this->entityInfo['entity keys']['bundle'])) {
$this->bundleKey = $this->entityInfo['entity keys']['bundle'];
}
}