Commit 20315e1d authored by alexpott's avatar alexpott

Issue #2164827 by Berdir, Xano, tim.plunkett: Rename the entityInfo() and...

Issue #2164827 by Berdir, Xano, tim.plunkett: Rename the entityInfo() and entityType() methods on EntityInterface and EntityStorageControllerInterface.
parent aa03c3dd
...@@ -501,7 +501,7 @@ function entity_list_controller($entity_type) { ...@@ -501,7 +501,7 @@ function entity_list_controller($entity_type) {
* A render array for the entity. * A render array for the entity.
*/ */
function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $reset = FALSE) { function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $reset = FALSE) {
$render_controller = \Drupal::entityManager()->getViewBuilder($entity->entityType()); $render_controller = \Drupal::entityManager()->getViewBuilder($entity->getEntityTypeId());
if ($reset) { if ($reset) {
$render_controller->resetCache(array($entity->id())); $render_controller->resetCache(array($entity->id()));
} }
...@@ -511,7 +511,7 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $res ...@@ -511,7 +511,7 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $res
/** /**
* Returns the render array for the provided entities. * Returns the render array for the provided entities.
* *
* @param array $entities * @param \Drupal\Core\Entity\EntityInterface[] $entities
* The entities to be rendered, must be of the same type. * The entities to be rendered, must be of the same type.
* @param string $view_mode * @param string $view_mode
* The view mode that should be used to display the entity. * The view mode that should be used to display the entity.
...@@ -527,7 +527,7 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $res ...@@ -527,7 +527,7 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $res
* entities array passed in $entities. * entities array passed in $entities.
*/ */
function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $reset = FALSE) { function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $reset = FALSE) {
$render_controller = \Drupal::entityManager()->getViewBuilder(reset($entities)->entityType()); $render_controller = \Drupal::entityManager()->getViewBuilder(reset($entities)->getEntityTypeId());
if ($reset) { if ($reset) {
$render_controller->resetCache(array_keys($entities)); $render_controller->resetCache(array_keys($entities));
} }
...@@ -619,7 +619,7 @@ function entity_get_display($entity_type, $bundle, $view_mode) { ...@@ -619,7 +619,7 @@ function entity_get_display($entity_type, $bundle, $view_mode) {
* @see entity_get_display(). * @see entity_get_display().
*/ */
function entity_get_render_display(EntityInterface $entity, $view_mode) { function entity_get_render_display(EntityInterface $entity, $view_mode) {
$entity_type = $entity->entityType(); $entity_type = $entity->getEntityTypeId();
$bundle = $entity->bundle(); $bundle = $entity->bundle();
$render_view_mode = 'default'; $render_view_mode = 'default';
...@@ -727,7 +727,7 @@ function entity_get_form_display($entity_type, $bundle, $form_mode) { ...@@ -727,7 +727,7 @@ function entity_get_form_display($entity_type, $bundle, $form_mode) {
* @see entity_get_form_display(). * @see entity_get_form_display().
*/ */
function entity_get_render_form_display(EntityInterface $entity, $form_mode) { function entity_get_render_form_display(EntityInterface $entity, $form_mode) {
$entity_type = $entity->entityType(); $entity_type = $entity->getEntityTypeId();
$bundle = $entity->bundle(); $bundle = $entity->bundle();
$render_form_mode = 'default'; $render_form_mode = 'default';
......
...@@ -23,7 +23,7 @@ public function load() { ...@@ -23,7 +23,7 @@ public function load() {
// Sort the entities using the entity class's sort() method. // Sort the entities using the entity class's sort() method.
// See \Drupal\Core\Config\Entity\ConfigEntityBase::sort(). // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort().
uasort($entities, array($this->entityInfo->getClass(), 'sort')); uasort($entities, array($this->entityType->getClass(), 'sort'));
return $entities; return $entities;
} }
...@@ -41,7 +41,7 @@ public function getOperations(EntityInterface $entity) { ...@@ -41,7 +41,7 @@ public function getOperations(EntityInterface $entity) {
$operations['edit']['href'] = $uri['path']; $operations['edit']['href'] = $uri['path'];
} }
if ($this->entityInfo->hasKey('status')) { if ($this->entityType->hasKey('status')) {
if (!$entity->status()) { if (!$entity->status()) {
$operations['enable'] = array( $operations['enable'] = array(
'title' => t('Enable'), 'title' => t('Enable'),
......
...@@ -96,8 +96,8 @@ class ConfigStorageController extends EntityStorageControllerBase implements Con ...@@ -96,8 +96,8 @@ class ConfigStorageController extends EntityStorageControllerBase implements Con
public function __construct(EntityTypeInterface $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service) { public function __construct(EntityTypeInterface $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service) {
parent::__construct($entity_info); parent::__construct($entity_info);
$this->idKey = $this->entityInfo->getKey('id'); $this->idKey = $this->entityType->getKey('id');
$this->statusKey = $this->entityInfo->getKey('status'); $this->statusKey = $this->entityType->getKey('status');
$this->configFactory = $config_factory; $this->configFactory = $config_factory;
$this->configStorage = $config_storage; $this->configStorage = $config_storage;
...@@ -183,14 +183,14 @@ public function deleteRevision($revision_id) { ...@@ -183,14 +183,14 @@ public function deleteRevision($revision_id) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getQuery($conjunction = 'AND') { public function getQuery($conjunction = 'AND') {
return $this->entityQueryFactory->get($this->entityType, $conjunction); return $this->entityQueryFactory->get($this->entityTypeId, $conjunction);
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getConfigPrefix() { public function getConfigPrefix() {
return $this->entityInfo->getConfigPrefix() . '.'; return $this->entityType->getConfigPrefix() . '.';
} }
/** /**
...@@ -222,7 +222,7 @@ public static function getIDFromConfigName($config_name, $config_prefix) { ...@@ -222,7 +222,7 @@ public static function getIDFromConfigName($config_name, $config_prefix) {
* A SelectQuery object for loading the entity. * A SelectQuery object for loading the entity.
*/ */
protected function buildQuery($ids, $revision_id = FALSE) { protected function buildQuery($ids, $revision_id = FALSE) {
$config_class = $this->entityInfo->getClass(); $config_class = $this->entityType->getClass();
$prefix = $this->getConfigPrefix(); $prefix = $this->getConfigPrefix();
// Get the names of the configuration entities we are going to load. // Get the names of the configuration entities we are going to load.
...@@ -240,7 +240,7 @@ protected function buildQuery($ids, $revision_id = FALSE) { ...@@ -240,7 +240,7 @@ protected function buildQuery($ids, $revision_id = FALSE) {
// Load all of the configuration entities. // Load all of the configuration entities.
$result = array(); $result = array();
foreach ($this->configFactory->loadMultiple($names) as $config) { foreach ($this->configFactory->loadMultiple($names) as $config) {
$result[$config->get($this->idKey)] = new $config_class($config->get(), $this->entityType); $result[$config->get($this->idKey)] = new $config_class($config->get(), $this->entityTypeId);
} }
return $result; return $result;
} }
...@@ -249,13 +249,13 @@ protected function buildQuery($ids, $revision_id = FALSE) { ...@@ -249,13 +249,13 @@ protected function buildQuery($ids, $revision_id = FALSE) {
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::create(). * Implements Drupal\Core\Entity\EntityStorageControllerInterface::create().
*/ */
public function create(array $values) { public function create(array $values) {
$class = $this->entityInfo->getClass(); $class = $this->entityType->getClass();
$class::preCreate($this, $values); $class::preCreate($this, $values);
// Set default language to site default if not provided. // Set default language to site default if not provided.
$values += array('langcode' => language_default()->id); $values += array('langcode' => language_default()->id);
$entity = new $class($values, $this->entityType); $entity = new $class($values, $this->entityTypeId);
// Mark this entity as new, so isNew() returns TRUE. This does not check // Mark this entity as new, so isNew() returns TRUE. This does not check
// whether a configuration entity with the same ID (if any) already exists. // whether a configuration entity with the same ID (if any) already exists.
$entity->enforceIsNew(); $entity->enforceIsNew();
...@@ -287,7 +287,7 @@ public function delete(array $entities) { ...@@ -287,7 +287,7 @@ public function delete(array $entities) {
return; return;
} }
$entity_class = $this->entityInfo->getClass(); $entity_class = $this->entityType->getClass();
$entity_class::preDelete($this, $entities); $entity_class::preDelete($this, $entities);
foreach ($entities as $entity) { foreach ($entities as $entity) {
$this->invokeHook('predelete', $entity); $this->invokeHook('predelete', $entity);
...@@ -328,7 +328,7 @@ public function save(EntityInterface $entity) { ...@@ -328,7 +328,7 @@ public function save(EntityInterface $entity) {
// Prevent overwriting an existing configuration file if the entity is new. // Prevent overwriting an existing configuration file if the entity is new.
if ($entity->isNew() && !$config->isNew()) { if ($entity->isNew() && !$config->isNew()) {
throw new EntityStorageException(String::format('@type entity with ID @id already exists.', array('@type' => $this->entityType, '@id' => $id))); throw new EntityStorageException(String::format('@type entity with ID @id already exists.', array('@type' => $this->entityTypeId, '@id' => $id)));
} }
if (!$config->isNew() && !isset($entity->original)) { if (!$config->isNew() && !isset($entity->original)) {
...@@ -389,9 +389,9 @@ public function save(EntityInterface $entity) { ...@@ -389,9 +389,9 @@ public function save(EntityInterface $entity) {
*/ */
protected function invokeHook($hook, EntityInterface $entity) { protected function invokeHook($hook, EntityInterface $entity) {
// Invoke the hook. // Invoke the hook.
module_invoke_all($this->entityType . '_' . $hook, $entity); module_invoke_all($this->entityTypeId . '_' . $hook, $entity);
// Invoke the respective entity-level hook. // Invoke the respective entity-level hook.
module_invoke_all('entity_' . $hook, $entity, $this->entityType); module_invoke_all('entity_' . $hook, $entity, $this->entityTypeId);
} }
/** /**
...@@ -415,7 +415,7 @@ public function importCreate($name, Config $new_config, Config $old_config) { ...@@ -415,7 +415,7 @@ public function importCreate($name, Config $new_config, Config $old_config) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function importUpdate($name, Config $new_config, Config $old_config) { public function importUpdate($name, Config $new_config, Config $old_config) {
$id = static::getIDFromConfigName($name, $this->entityInfo->getConfigPrefix()); $id = static::getIDFromConfigName($name, $this->entityType->getConfigPrefix());
$entity = $this->load($id); $entity = $this->load($id);
$entity->setSyncing(TRUE); $entity->setSyncing(TRUE);
$entity->original = clone $entity; $entity->original = clone $entity;
...@@ -436,7 +436,7 @@ public function importUpdate($name, Config $new_config, Config $old_config) { ...@@ -436,7 +436,7 @@ public function importUpdate($name, Config $new_config, Config $old_config) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function importDelete($name, Config $new_config, Config $old_config) { public function importDelete($name, Config $new_config, Config $old_config) {
$id = static::getIDFromConfigName($name, $this->entityInfo->getConfigPrefix()); $id = static::getIDFromConfigName($name, $this->entityType->getConfigPrefix());
$entity = $this->load($id); $entity = $this->load($id);
$entity->setSyncing(TRUE); $entity->setSyncing(TRUE);
$entity->delete(); $entity->delete();
......
...@@ -52,8 +52,8 @@ public function __construct(EntityTypeInterface $entity_info, EntityStorageContr ...@@ -52,8 +52,8 @@ public function __construct(EntityTypeInterface $entity_info, EntityStorageContr
parent::__construct($entity_info, $storage); parent::__construct($entity_info, $storage);
// Check if the entity type supports weighting. // Check if the entity type supports weighting.
if ($this->entityInfo->hasKey('weight')) { if ($this->entityType->hasKey('weight')) {
$this->weightKey = $this->entityInfo->getKey('weight'); $this->weightKey = $this->entityType->getKey('weight');
} }
} }
...@@ -106,7 +106,7 @@ public function buildForm(array $form, array &$form_state) { ...@@ -106,7 +106,7 @@ public function buildForm(array $form, array &$form_state) {
$form[$this->entitiesKey] = array( $form[$this->entitiesKey] = array(
'#type' => 'table', '#type' => 'table',
'#header' => $this->buildHeader(), '#header' => $this->buildHeader(),
'#empty' => t('There is no @label yet.', array('@label' => $this->entityInfo->getLabel())), '#empty' => t('There is no @label yet.', array('@label' => $this->entityType->getLabel())),
'#tabledrag' => array( '#tabledrag' => array(
array( array(
'action' => 'order', 'action' => 'order',
......
...@@ -132,8 +132,8 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C ...@@ -132,8 +132,8 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
* Overrides Entity::__construct(). * Overrides Entity::__construct().
*/ */
public function __construct(array $values, $entity_type, $bundle = FALSE, $translations = array()) { public function __construct(array $values, $entity_type, $bundle = FALSE, $translations = array()) {
$this->entityType = $entity_type; $this->entityTypeId = $entity_type;
$this->bundle = $bundle ? $bundle : $this->entityType; $this->bundle = $bundle ? $bundle : $this->entityTypeId;
$this->languages = language_list(Language::STATE_ALL); $this->languages = language_list(Language::STATE_ALL);
foreach ($values as $key => $value) { foreach ($values as $key => $value) {
...@@ -172,7 +172,7 @@ public function setNewRevision($value = TRUE) { ...@@ -172,7 +172,7 @@ public function setNewRevision($value = TRUE) {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isNewRevision() { public function isNewRevision() {
return $this->newRevision || ($this->entityInfo()->hasKey('revision') && !$this->getRevisionId()); return $this->newRevision || ($this->getEntityType()->hasKey('revision') && !$this->getRevisionId());
} }
/** /**
...@@ -198,7 +198,7 @@ public function getRevisionId() { ...@@ -198,7 +198,7 @@ public function getRevisionId() {
*/ */
public function isTranslatable() { public function isTranslatable() {
// @todo Inject the entity manager and retrieve bundle info from it. // @todo Inject the entity manager and retrieve bundle info from it.
$bundles = entity_get_bundles($this->entityType); $bundles = entity_get_bundles($this->entityTypeId);
return !empty($bundles[$this->bundle()]['translatable']); return !empty($bundles[$this->bundle()]['translatable']);
} }
...@@ -214,11 +214,11 @@ public function preSaveRevision(EntityStorageControllerInterface $storage_contro ...@@ -214,11 +214,11 @@ public function preSaveRevision(EntityStorageControllerInterface $storage_contro
public function getDefinition() { public function getDefinition() {
// @todo: This does not make much sense, so remove once TypedDataInterface // @todo: This does not make much sense, so remove once TypedDataInterface
// is removed. See https://drupal.org/node/2002138. // is removed. See https://drupal.org/node/2002138.
if ($this->bundle() != $this->entityType()) { if ($this->bundle() != $this->getEntityTypeId()) {
$type = 'entity:' . $this->entityType() . ':' . $this->bundle(); $type = 'entity:' . $this->getEntityTypeId() . ':' . $this->bundle();
} }
else { else {
$type = 'entity:' . $this->entityType(); $type = 'entity:' . $this->getEntityTypeId();
} }
return DataDefinition::create($type); return DataDefinition::create($type);
} }
...@@ -485,8 +485,8 @@ public function getPropertyDefinition($name) { ...@@ -485,8 +485,8 @@ public function getPropertyDefinition($name) {
*/ */
public function getPropertyDefinitions() { public function getPropertyDefinitions() {
if (!isset($this->fieldDefinitions)) { if (!isset($this->fieldDefinitions)) {
$bundle = $this->bundle != $this->entityType ? $this->bundle : NULL; $bundle = $this->bundle != $this->entityTypeId ? $this->bundle : NULL;
$this->fieldDefinitions = \Drupal::entityManager()->getFieldDefinitions($this->entityType, $bundle); $this->fieldDefinitions = \Drupal::entityManager()->getFieldDefinitions($this->entityTypeId, $bundle);
} }
return $this->fieldDefinitions; return $this->fieldDefinitions;
} }
...@@ -532,11 +532,11 @@ public function isEmpty() { ...@@ -532,11 +532,11 @@ public function isEmpty() {
public function access($operation = 'view', AccountInterface $account = NULL) { public function access($operation = 'view', AccountInterface $account = NULL) {
if ($operation == 'create') { if ($operation == 'create') {
return \Drupal::entityManager() return \Drupal::entityManager()
->getAccessController($this->entityType) ->getAccessController($this->entityTypeId)
->createAccess($this->bundle(), $account); ->createAccess($this->bundle(), $account);
} }
return \Drupal::entityManager() return \Drupal::entityManager()
->getAccessController($this->entityType) ->getAccessController($this->entityTypeId)
->access($this, $operation, $this->activeLangcode, $account); ->access($this, $operation, $this->activeLangcode, $account);
} }
...@@ -716,10 +716,10 @@ public function addTranslation($langcode, array $values = array()) { ...@@ -716,10 +716,10 @@ public function addTranslation($langcode, array $values = array()) {
// Instantiate a new empty entity so default values will be populated in the // Instantiate a new empty entity so default values will be populated in the
// specified language. // specified language.
$info = $this->entityInfo(); $info = $this->getEntityType();
$default_values = array($info->getKey('bundle') => $this->bundle, 'langcode' => $langcode); $default_values = array($info->getKey('bundle') => $this->bundle, 'langcode' => $langcode);
$entity = \Drupal::entityManager() $entity = \Drupal::entityManager()
->getStorageController($this->entityType()) ->getStorageController($this->getEntityTypeId())
->create($default_values); ->create($default_values);
foreach ($entity as $name => $field) { foreach ($entity as $name => $field) {
...@@ -902,7 +902,7 @@ public function createDuplicate() { ...@@ -902,7 +902,7 @@ public function createDuplicate() {
} }
$duplicate = clone $this; $duplicate = clone $this;
$entity_info = $this->entityInfo(); $entity_info = $this->getEntityType();
$duplicate->{$entity_info->getKey('id')}->value = NULL; $duplicate->{$entity_info->getKey('id')}->value = NULL;
// Check if the entity type supports UUIDs and generate a new one if so. // Check if the entity type supports UUIDs and generate a new one if so.
...@@ -955,7 +955,7 @@ public function __clone() { ...@@ -955,7 +955,7 @@ public function __clone() {
*/ */
public function label() { public function label() {
$label = NULL; $label = NULL;
$entity_info = $this->entityInfo(); $entity_info = $this->getEntityType();
// @todo Convert to is_callable() and call_user_func(). // @todo Convert to is_callable() and call_user_func().
if (($label_callback = $entity_info->getLabelCallback()) && function_exists($label_callback)) { if (($label_callback = $entity_info->getLabelCallback()) && function_exists($label_callback)) {
$label = $label_callback($this); $label = $label_callback($this);
......
...@@ -19,7 +19,7 @@ abstract class ContentEntityConfirmFormBase extends ContentEntityFormController ...@@ -19,7 +19,7 @@ abstract class ContentEntityConfirmFormBase extends ContentEntityFormController
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getBaseFormID() { public function getBaseFormID() {
return $this->entity->entityType() . '_confirm_form'; return $this->entity->getEntityTypeId() . '_confirm_form';
} }
/** /**
......
...@@ -50,7 +50,7 @@ public function form(array $form, array &$form_state) { ...@@ -50,7 +50,7 @@ public function form(array $form, array &$form_state) {
$entity = $this->entity; $entity = $this->entity;
// @todo Exploit the Field API to generate the default widgets for the // @todo Exploit the Field API to generate the default widgets for the
// entity fields. // entity fields.
if ($entity->entityInfo()->isFieldable()) { if ($entity->getEntityType()->isFieldable()) {
field_attach_form($entity, $form, $form_state, $this->getFormLangcode($form_state)); field_attach_form($entity, $form, $form_state, $this->getFormLangcode($form_state));
} }
...@@ -66,7 +66,7 @@ public function form(array $form, array &$form_state) { ...@@ -66,7 +66,7 @@ public function form(array $form, array &$form_state) {
public function validate(array $form, array &$form_state) { public function validate(array $form, array &$form_state) {
$this->updateFormLangcode($form_state); $this->updateFormLangcode($form_state);
$entity = $this->buildEntity($form, $form_state); $entity = $this->buildEntity($form, $form_state);
$entity_type = $entity->entityType(); $entity_type = $entity->getEntityTypeId();
$entity_langcode = $entity->language()->id; $entity_langcode = $entity->language()->id;
$violations = array(); $violations = array();
...@@ -130,7 +130,7 @@ public function isDefaultFormLangcode(array $form_state) { ...@@ -130,7 +130,7 @@ public function isDefaultFormLangcode(array $form_state) {
*/ */
public function buildEntity(array $form, array &$form_state) { public function buildEntity(array $form, array &$form_state) {
$entity = clone $this->entity; $entity = clone $this->entity;
$entity_type = $entity->entityType(); $entity_type = $entity->getEntityTypeId();
$info = \Drupal::entityManager()->getDefinition($entity_type); $info = \Drupal::entityManager()->getDefinition($entity_type);
// @todo Exploit the Entity Field API to process the submitted field values. // @todo Exploit the Entity Field API to process the submitted field values.
......
...@@ -62,7 +62,7 @@ public static function create(ContainerInterface $container) { ...@@ -62,7 +62,7 @@ public static function create(ContainerInterface $container) {
*/ */
public function view(EntityInterface $_entity, $view_mode = 'full', $langcode = NULL) { public function view(EntityInterface $_entity, $view_mode = 'full', $langcode = NULL) {
return $this->entityManager return $this->entityManager
->getViewBuilder($_entity->entityType()) ->getViewBuilder($_entity->getEntityTypeId())
->view($_entity, $view_mode, $langcode); ->view($_entity, $view_mode, $langcode);
} }
......
...@@ -86,10 +86,10 @@ public function __construct(EntityTypeInterface $entity_info, Connection $databa ...@@ -86,10 +86,10 @@ public function __construct(EntityTypeInterface $entity_info, Connection $databa
$this->uuidService = $uuid_service; $this->uuidService = $uuid_service;
// Check if the entity type supports IDs. // Check if the entity type supports IDs.
$this->idKey = $this->entityInfo->getKey('id'); $this->idKey = $this->entityType->getKey('id');
// Check if the entity type supports UUIDs. // Check if the entity type supports UUIDs.
$this->uuidKey = $this->entityInfo->getKey('uuid'); $this->uuidKey = $this->entityType->getKey('uuid');
} }
/** /**
...@@ -121,11 +121,11 @@ public function loadMultiple(array $ids = NULL) { ...@@ -121,11 +121,11 @@ public function loadMultiple(array $ids = NULL) {
// Build and execute the query. // Build and execute the query.
$query_result = $this->buildQuery($ids)->execute(); $query_result = $this->buildQuery($ids)->execute();
if ($class = $this->entityInfo->getClass()) { if ($class = $this->entityType->getClass()) {
// We provide the necessary arguments for PDO to create objects of the // We provide the necessary arguments for PDO to create objects of the
// specified entity class. // specified entity class.
// @see \Drupal\Core\Entity\EntityInterface::__construct() // @see \Drupal\Core\Entity\EntityInterface::__construct()
$query_result->setFetchMode(\PDO::FETCH_CLASS, $class, array(array(), $this->entityType)); $query_result->setFetchMode(\PDO::FETCH_CLASS, $class, array(array(), $this->entityTypeId));
} }
$queried_entities = $query_result->fetchAllAssoc($this->idKey); $queried_entities = $query_result->fetchAllAssoc($this->idKey);
} }
...@@ -186,7 +186,7 @@ public function deleteRevision($revision_id) { ...@@ -186,7 +186,7 @@ public function deleteRevision($revision_id) {
*/ */
public function loadByProperties(array $values = array()) { public function loadByProperties(array $values = array()) {
// Build a query to fetch the entity IDs. // Build a query to fetch the entity IDs.
$entity_query = \Drupal::entityQuery($this->entityType); $entity_query = \Drupal::entityQuery($this->entityTypeId);
$this->buildPropertyQuery($entity_query, $values); $this->buildPropertyQuery($entity_query, $values);
$result = $entity_query->execute(); $result = $entity_query->execute();
return $result ? $this->loadMultiple($result) : array(); return $result ? $this->loadMultiple($result) : array();
...@@ -217,12 +217,12 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value ...@@ -217,12 +217,12 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value
* A SelectQuery object for loading the entity. * A SelectQuery object for loading the entity.
*/ */
protected function buildQuery($ids, $revision_id = FALSE) { protected function buildQuery($ids, $revision_id = FALSE) {