DrupalDefaultEntityController::__construct

public function DrupalDefaultEntityController::__construct

public DrupalDefaultEntityController::__construct($entityType)

Constructor: sets basic variables.

Parameters

$entityType: The entity type for which the instance is created.

File

includes/entity.inc, line 120

Class

DrupalDefaultEntityController
Default implementation of DrupalEntityControllerInterface.

Code

public function __construct($entityType) {
  $this->entityType = $entityType;
  $this->entityInfo = entity_get_info($entityType);
  $this->entityCache = array();
  $this->hookLoadArguments = array();
  $this->idKey = $this->entityInfo['entity keys']['id'];

  // Check if the entity type supports revisions.
  if (!empty($this->entityInfo['entity keys']['revision'])) {
    $this->revisionKey = $this->entityInfo['entity keys']['revision'];
    $this->revisionTable = $this->entityInfo['revision table'];
  }
  else {
    $this->revisionKey = FALSE;
  }

  // Check if the entity type supports static caching of loaded entities.
  $this->cache = !empty($this->entityInfo['static cache']);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!entity.inc/function/DrupalDefaultEntityController::__construct/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部