Issue #2269003 by damiankloip, Berdir: Fixed Unnecessary high memory usage in EntityType::getKeys().
parent
559115bf0d
commit
0616fed294
|
@ -63,8 +63,11 @@ class ConfigEntityType extends EntityType {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getControllerClasses() {
|
||||
return parent::getControllerClasses() + array(
|
||||
public function __construct($definition) {
|
||||
parent::__construct($definition);
|
||||
// Always add a default 'uuid' key.
|
||||
$this->entity_keys['uuid'] = 'uuid';
|
||||
$this->controllers += array(
|
||||
'storage' => 'Drupal\Core\Config\Entity\ConfigEntityStorage',
|
||||
);
|
||||
}
|
||||
|
@ -94,15 +97,6 @@ class ConfigEntityType extends EntityType {
|
|||
return $config_prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getKeys() {
|
||||
// Always add a default 'uuid' key.
|
||||
return array('uuid' => 'uuid') + parent::getKeys();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
@ -15,8 +15,9 @@ class ContentEntityType extends EntityType implements ContentEntityTypeInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getControllerClasses() {
|
||||
return parent::getControllerClasses() + array(
|
||||
public function __construct($definition) {
|
||||
parent::__construct($definition);
|
||||
$this->controllers += array(
|
||||
'storage' => 'Drupal\Core\Entity\ContentEntityDatabaseStorage',
|
||||
);
|
||||
}
|
||||
|
|
|
@ -217,6 +217,15 @@ class EntityType implements EntityTypeInterface {
|
|||
foreach ($definition as $property => $value) {
|
||||
$this->{$property} = $value;
|
||||
}
|
||||
|
||||
// Ensure defaults.
|
||||
$this->entity_keys += array(
|
||||
'revision' => '',
|
||||
'bundle' => ''
|
||||
);
|
||||
$this->controllers += array(
|
||||
'access' => 'Drupal\Core\Entity\EntityAccessController',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -259,7 +268,7 @@ class EntityType implements EntityTypeInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getKeys() {
|
||||
return $this->entity_keys + array('revision' => '', 'bundle' => '');
|
||||
return $this->entity_keys;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -318,9 +327,7 @@ class EntityType implements EntityTypeInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getControllerClasses() {
|
||||
return $this->controllers + array(
|
||||
'access' => 'Drupal\Core\Entity\EntityAccessController',
|
||||
);
|
||||
return $this->controllers;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue