You are here

public function EntityDefaultFeaturesController::__construct in Entity API 7

File

./entity.features.inc, line 34
Provides Features integration for entity types using the CRUD API.

Class

EntityDefaultFeaturesController
Default controller handling features integration.

Code

public function __construct($type) {
  $this->type = $type;
  $this->info = entity_get_info($type);
  $this->info['entity keys'] += array(
    'module' => 'module',
    'status' => 'status',
  );
  $this->statusKey = $this->info['entity keys']['status'];
  $this->moduleKey = $this->info['entity keys']['module'];
  if (!empty($this->info['bundle of'])) {
    $entity_info = entity_get_info($this->info['bundle of']);
    $this->bundleKey = $entity_info['bundle keys']['bundle'];
  }
}