diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php index 979dddd..2cd3faf 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php @@ -23,7 +23,7 @@ public function load() { // Sort the entities using the entity class's sort() method. // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort(). - uasort($entities, array($this->entityInfo->getClass(), 'sort')); + uasort($entities, array($this->entityType->getClass(), 'sort')); return $entities; } @@ -41,7 +41,7 @@ public function getOperations(EntityInterface $entity) { $operations['edit']['href'] = $uri['path']; } - if ($this->entityInfo->hasKey('status')) { + if ($this->entityType->hasKey('status')) { if (!$entity->status()) { $operations['enable'] = array( 'title' => t('Enable'), diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php index 809f186..1d973e4 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -96,8 +96,8 @@ class ConfigStorageController extends EntityStorageControllerBase { public function __construct(EntityTypeInterface $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service) { parent::__construct($entity_info); - $this->idKey = $this->entityInfo->getKey('id'); - $this->statusKey = $this->entityInfo->getKey('status'); + $this->idKey = $this->entityType->getKey('id'); + $this->statusKey = $this->entityType->getKey('status'); $this->configFactory = $config_factory; $this->configStorage = $config_storage; @@ -192,7 +192,7 @@ public function deleteRevision($revision_id) { * @see \Drupal\Core\Entity\EntityStorageControllerInterface::getQueryServicename() */ public function getQuery($conjunction = 'AND') { - return $this->entityQueryFactory->get($this->entityType, $conjunction); + return $this->entityQueryFactory->get($this->entityTypeId, $conjunction); } /** @@ -202,7 +202,7 @@ public function getQuery($conjunction = 'AND') { * The full configuration prefix, for example 'views.view.'. */ public function getConfigPrefix() { - return $this->entityInfo->getConfigPrefix() . '.'; + return $this->entityType->getConfigPrefix() . '.'; } /** @@ -243,7 +243,7 @@ public static function getIDFromConfigName($config_name, $config_prefix) { * A SelectQuery object for loading the entity. */ protected function buildQuery($ids, $revision_id = FALSE) { - $config_class = $this->entityInfo->getClass(); + $config_class = $this->entityType->getClass(); $prefix = $this->getConfigPrefix(); // Get the names of the configuration entities we are going to load. @@ -261,7 +261,7 @@ protected function buildQuery($ids, $revision_id = FALSE) { // Load all of the configuration entities. $result = array(); 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; } @@ -270,13 +270,13 @@ protected function buildQuery($ids, $revision_id = FALSE) { * Implements Drupal\Core\Entity\EntityStorageControllerInterface::create(). */ public function create(array $values) { - $class = $this->entityInfo->getClass(); + $class = $this->entityType->getClass(); $class::preCreate($this, $values); // Set default language to site default if not provided. $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 // whether a configuration entity with the same ID (if any) already exists. $entity->enforceIsNew(); @@ -308,7 +308,7 @@ public function delete(array $entities) { return; } - $entity_class = $this->entityInfo->getClass(); + $entity_class = $this->entityType->getClass(); $entity_class::preDelete($this, $entities); foreach ($entities as $entity) { $this->invokeHook('predelete', $entity); @@ -349,7 +349,7 @@ public function save(EntityInterface $entity) { // Prevent overwriting an existing configuration file if the entity is new. 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)) { @@ -410,9 +410,9 @@ public function save(EntityInterface $entity) { */ protected function invokeHook($hook, EntityInterface $entity) { // Invoke the hook. - module_invoke_all($this->entityType . '_' . $hook, $entity); + module_invoke_all($this->entityTypeId . '_' . $hook, $entity); // Invoke the respective entity-level hook. - module_invoke_all('entity_' . $hook, $entity, $this->entityType); + module_invoke_all('entity_' . $hook, $entity, $this->entityTypeId); } /** @@ -456,7 +456,7 @@ public function importCreate($name, Config $new_config, Config $old_config) { * A configuration object containing the old configuration data. */ 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->setSyncing(TRUE); $entity->original = clone $entity; @@ -487,7 +487,7 @@ public function importUpdate($name, Config $new_config, Config $old_config) { * A configuration object containing the old configuration data. */ 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->setSyncing(TRUE); $entity->delete(); diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListController.php b/core/lib/Drupal/Core/Config/Entity/DraggableListController.php index c606a47..d057bc9 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListController.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListController.php @@ -52,8 +52,8 @@ public function __construct(EntityTypeInterface $entity_info, EntityStorageContr parent::__construct($entity_info, $storage); // Check if the entity type supports weighting. - if ($this->entityInfo->hasKey('weight')) { - $this->weightKey = $this->entityInfo->getKey('weight'); + if ($this->entityType->hasKey('weight')) { + $this->weightKey = $this->entityType->getKey('weight'); } } @@ -106,7 +106,7 @@ public function buildForm(array $form, array &$form_state) { $form[$this->entitiesKey] = array( '#type' => 'table', '#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( array( 'action' => 'order', diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 6e732cc..9e89c97 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -132,8 +132,8 @@ * Overrides Entity::__construct(). */ public function __construct(array $values, $entity_type, $bundle = FALSE, $translations = array()) { - $this->entityType = $entity_type; - $this->bundle = $bundle ? $bundle : $this->entityType; + $this->entityTypeId = $entity_type; + $this->bundle = $bundle ? $bundle : $this->entityTypeId; $this->languages = language_list(Language::STATE_ALL); foreach ($values as $key => $value) { @@ -198,7 +198,7 @@ public function getRevisionId() { */ public function isTranslatable() { // @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']); } @@ -485,8 +485,8 @@ public function getPropertyDefinition($name) { */ public function getPropertyDefinitions() { if (!isset($this->fieldDefinitions)) { - $bundle = $this->bundle != $this->entityType ? $this->bundle : NULL; - $this->fieldDefinitions = \Drupal::entityManager()->getFieldDefinitions($this->entityType, $bundle); + $bundle = $this->bundle != $this->entityTypeId ? $this->bundle : NULL; + $this->fieldDefinitions = \Drupal::entityManager()->getFieldDefinitions($this->entityTypeId, $bundle); } return $this->fieldDefinitions; } @@ -532,11 +532,11 @@ public function isEmpty() { public function access($operation = 'view', AccountInterface $account = NULL) { if ($operation == 'create') { return \Drupal::entityManager() - ->getAccessController($this->entityType) + ->getAccessController($this->entityTypeId) ->createAccess($this->bundle(), $account); } return \Drupal::entityManager() - ->getAccessController($this->entityType) + ->getAccessController($this->entityTypeId) ->access($this, $operation, $this->activeLangcode, $account); } diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php index bfbdfb4..e137322 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php @@ -86,10 +86,10 @@ public function __construct(EntityTypeInterface $entity_info, Connection $databa $this->uuidService = $uuid_service; // 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. - $this->uuidKey = $this->entityInfo->getKey('uuid'); + $this->uuidKey = $this->entityType->getKey('uuid'); } /** @@ -121,11 +121,11 @@ public function loadMultiple(array $ids = NULL) { // Build and execute the query. $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 // specified entity class. // @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); } @@ -186,7 +186,7 @@ public function deleteRevision($revision_id) { */ public function loadByProperties(array $values = array()) { // 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); $result = $entity_query->execute(); return $result ? $this->loadMultiple($result) : array(); @@ -217,12 +217,12 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value * A SelectQuery object for loading the entity. */ protected function buildQuery($ids, $revision_id = FALSE) { - $query = $this->database->select($this->entityInfo->getBaseTable(), 'base'); + $query = $this->database->select($this->entityType->getBaseTable(), 'base'); - $query->addTag($this->entityType . '_load_multiple'); + $query->addTag($this->entityTypeId . '_load_multiple'); // Add fields from the {entity} table. - $entity_fields = drupal_schema_fields_sql($this->entityInfo->getBaseTable()); + $entity_fields = drupal_schema_fields_sql($this->entityType->getBaseTable()); $query->fields('base', $entity_fields); if ($ids) { @@ -236,10 +236,10 @@ protected function buildQuery($ids, $revision_id = FALSE) { * {@inheritdoc} */ public function create(array $values) { - $entity_class = $this->entityInfo->getClass(); + $entity_class = $this->entityType->getClass(); $entity_class::preCreate($this, $values); - $entity = new $entity_class($values, $this->entityType); + $entity = new $entity_class($values, $this->entityTypeId); // Assign a new UUID if there is none yet. if ($this->uuidKey && !isset($entity->{$this->uuidKey})) { @@ -265,14 +265,14 @@ public function delete(array $entities) { $transaction = $this->database->startTransaction(); try { - $entity_class = $this->entityInfo->getClass(); + $entity_class = $this->entityType->getClass(); $entity_class::preDelete($this, $entities); foreach ($entities as $entity) { $this->invokeHook('predelete', $entity); } $ids = array_keys($entities); - $this->database->delete($this->entityInfo->getBaseTable()) + $this->database->delete($this->entityType->getBaseTable()) ->condition($this->idKey, $ids, 'IN') ->execute(); @@ -288,7 +288,7 @@ public function delete(array $entities) { } catch (\Exception $e) { $transaction->rollback(); - watchdog_exception($this->entityType, $e); + watchdog_exception($this->entityTypeId, $e); throw new EntityStorageException($e->getMessage(), $e->getCode(), $e); } } @@ -301,20 +301,20 @@ public function save(EntityInterface $entity) { try { // Load the stored entity, if any. if (!$entity->isNew() && !isset($entity->original)) { - $entity->original = entity_load_unchanged($this->entityType, $entity->id()); + $entity->original = entity_load_unchanged($this->entityTypeId, $entity->id()); } $entity->preSave($this); $this->invokeHook('presave', $entity); if (!$entity->isNew()) { - $return = drupal_write_record($this->entityInfo->getBaseTable(), $entity, $this->idKey); + $return = drupal_write_record($this->entityType->getBaseTable(), $entity, $this->idKey); $this->resetCache(array($entity->id())); $entity->postSave($this, TRUE); $this->invokeHook('update', $entity); } else { - $return = drupal_write_record($this->entityInfo->getBaseTable(), $entity); + $return = drupal_write_record($this->entityType->getBaseTable(), $entity); // Reset general caches, but keep caches specific to certain entities. $this->resetCache(array()); @@ -331,7 +331,7 @@ public function save(EntityInterface $entity) { } catch (\Exception $e) { $transaction->rollback(); - watchdog_exception($this->entityType, $e); + watchdog_exception($this->entityTypeId, $e); throw new EntityStorageException($e->getMessage(), $e->getCode(), $e); } } diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index ac288ea..51eafd3 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -28,7 +28,7 @@ * * @var string */ - protected $entityType; + protected $entityTypeId; /** * Boolean indicating whether the entity should be forced to be new. @@ -61,7 +61,7 @@ * The type of the entity to create. */ public function __construct(array $values, $entity_type) { - $this->entityType = $entity_type; + $this->entityTypeId = $entity_type; // Set initial values. foreach ($values as $key => $value) { $this->$key = $value; @@ -100,14 +100,14 @@ public function enforceIsNew($value = TRUE) { * {@inheritdoc} */ public function entityTypeId() { - return $this->entityType; + return $this->entityTypeId; } /** * {@inheritdoc} */ public function bundle() { - return $this->entityType; + return $this->entityTypeId; } /** @@ -181,7 +181,7 @@ public function uri($rel = 'canonical') { // Pass the entity data to url() so that alter functions do not need to // look up this entity again. - $uri['options']['entity_type'] = $this->entityType; + $uri['options']['entity_type'] = $this->entityTypeId; $uri['options']['entity'] = $this; return $uri; } @@ -189,7 +189,7 @@ public function uri($rel = 'canonical') { $bundle = $this->bundle(); // A bundle-specific callback takes precedence over the generic one for // the entity type. - $bundles = entity_get_bundles($this->entityType); + $bundles = entity_get_bundles($this->entityTypeId); if (isset($bundles[$bundle]['uri_callback'])) { $uri_callback = $bundles[$bundle]['uri_callback']; } @@ -207,7 +207,7 @@ public function uri($rel = 'canonical') { // Other relationship types are not supported by this logic. elseif ($rel == 'canonical') { $uri = array( - 'path' => 'entity/' . $this->entityType . '/' . $this->id(), + 'path' => 'entity/' . $this->entityTypeId . '/' . $this->id(), ); } else { @@ -271,11 +271,11 @@ public function uriRelationships() { public function access($operation = 'view', AccountInterface $account = NULL) { if ($operation == 'create') { return \Drupal::entityManager() - ->getAccessController($this->entityType) + ->getAccessController($this->entityTypeId) ->createAccess($this->bundle(), $account); } return \Drupal::entityManager() - ->getAccessController($this->entityType) + ->getAccessController($this->entityTypeId) ->access($this, $operation, Language::LANGCODE_DEFAULT, $account); } @@ -295,7 +295,7 @@ public function language() { * {@inheritdoc} */ public function save() { - return \Drupal::entityManager()->getStorageController($this->entityType)->save($this); + return \Drupal::entityManager()->getStorageController($this->entityTypeId)->save($this); } /** @@ -303,7 +303,7 @@ public function save() { */ public function delete() { if (!$this->isNew()) { - \Drupal::entityManager()->getStorageController($this->entityType)->delete(array($this->id() => $this)); + \Drupal::entityManager()->getStorageController($this->entityTypeId)->delete(array($this->id() => $this)); } } diff --git a/core/lib/Drupal/Core/Entity/EntityAccessController.php b/core/lib/Drupal/Core/Entity/EntityAccessController.php index 11322cc..84e90d5 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessController.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessController.php @@ -27,18 +27,18 @@ class EntityAccessController extends EntityControllerBase implements EntityAcces protected $accessCache = array(); /** - * The entity type of the access controller instance. + * The entity type ID of the access controller instance. * * @var string */ - protected $entityType; + protected $entityTypeId; /** - * The entity info array. + * Information about the entity type. * * @var \Drupal\Core\Entity\EntityTypeInterface */ - protected $entityInfo; + protected $entityType; /** * Constructs an access controller instance. @@ -47,8 +47,8 @@ class EntityAccessController extends EntityControllerBase implements EntityAcces * The entity info for the entity type. */ public function __construct(EntityTypeInterface $entity_info) { - $this->entityType = $entity_info->id(); - $this->entityInfo = $entity_info; + $this->entityTypeId = $entity_info->id(); + $this->entityType = $entity_info; } /** @@ -129,7 +129,7 @@ protected function processAccessHookResults(array $access) { * could not be determined. */ protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) { - if ($admin_permission = $this->entityInfo->getAdminPermission()) { + if ($admin_permission = $this->entityType->getAdminPermission()) { return $account->hasPermission($admin_permission); } else { @@ -220,7 +220,7 @@ public function createAccess($entity_bundle = NULL, AccountInterface $account = // - At least one module says to grant access. $access = array_merge( $this->moduleHandler()->invokeAll('entity_create_access', array($account, $context['langcode'])), - $this->moduleHandler()->invokeAll($this->entityType . '_create_access', array($account, $context['langcode'])) + $this->moduleHandler()->invokeAll($this->entityTypeId . '_create_access', array($account, $context['langcode'])) ); if (($return = $this->processAccessHookResults($access)) === NULL) { @@ -250,7 +250,7 @@ public function createAccess($entity_bundle = NULL, AccountInterface $account = * could not be determined. */ protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { - if ($admin_permission = $this->entityInfo->getAdminPermission()) { + if ($admin_permission = $this->entityType->getAdminPermission()) { return $account->hasPermission($admin_permission); } else { diff --git a/core/lib/Drupal/Core/Entity/EntityListController.php b/core/lib/Drupal/Core/Entity/EntityListController.php index b169e2f..e224860 100644 --- a/core/lib/Drupal/Core/Entity/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/EntityListController.php @@ -25,18 +25,18 @@ class EntityListController extends EntityControllerBase implements EntityListCon protected $storage; /** - * The entity type name. + * The entity type ID. * * @var string */ - protected $entityType; + protected $entityTypeId; /** - * The entity info array. + * Information about the entity type. * * @var \Drupal\Core\Entity\EntityTypeInterface */ - protected $entityInfo; + protected $entityType; /** * {@inheritdoc} @@ -57,9 +57,9 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * The entity storage controller class. */ public function __construct(EntityTypeInterface $entity_info, EntityStorageControllerInterface $storage) { - $this->entityType = $entity_info->id(); + $this->entityTypeId = $entity_info->id(); $this->storage = $storage; - $this->entityInfo = $entity_info; + $this->entityType = $entity_info; } /** @@ -181,7 +181,7 @@ public function render() { '#header' => $this->buildHeader(), '#title' => $this->getTitle(), '#rows' => array(), - '#empty' => $this->t('There is no @label yet.', array('@label' => $this->entityInfo->getLabel())), + '#empty' => $this->t('There is no @label yet.', array('@label' => $this->entityType->getLabel())), ); foreach ($this->load() as $entity) { if ($row = $this->buildRow($entity)) { diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php index c0e130c..741cdce 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php @@ -24,25 +24,23 @@ /** * Whether this entity type should use the static cache. * - * Set by entity info. - * * @var boolean */ protected $cache; /** - * Entity type for this controller instance. + * Entity type ID for this controller instance. * * @var string */ - protected $entityType; + protected $entityTypeId; /** - * Array of information about the entity. + * Information about the entity type. * * @var \Drupal\Core\Entity\EntityTypeInterface */ - protected $entityInfo; + protected $entityType; /** * Name of the entity's ID field in the entity database table. @@ -67,24 +65,24 @@ * The entity info for the entity type. */ public function __construct(EntityTypeInterface $entity_info) { - $this->entityType = $entity_info->id(); - $this->entityInfo = $entity_info; + $this->entityTypeId = $entity_info->id(); + $this->entityType = $entity_info; // Check if the entity type supports static caching of loaded entities. - $this->cache = $this->entityInfo->isStaticallyCacheable(); + $this->cache = $this->entityType->isStaticallyCacheable(); } /** * {@inheritdoc} */ public function entityTypeId() { - return $this->entityType; + return $this->entityTypeId; } /** * {@inheritdoc} */ public function entityType() { - return $this->entityInfo; + return $this->entityType; } /** @@ -150,9 +148,9 @@ protected function cacheSet($entities) { */ protected function invokeHook($hook, EntityInterface $entity) { // Invoke the hook. - $this->moduleHandler()->invokeAll($this->entityType . '_' . $hook, array($entity)); + $this->moduleHandler()->invokeAll($this->entityTypeId . '_' . $hook, array($entity)); // Invoke the respective entity-level hook. - $this->moduleHandler()->invokeAll('entity_' . $hook, array($entity, $this->entityType)); + $this->moduleHandler()->invokeAll('entity_' . $hook, array($entity, $this->entityTypeId)); } /** @@ -162,16 +160,16 @@ protected function invokeHook($hook, EntityInterface $entity) { * Associative array of query results, keyed on the entity ID. */ protected function postLoad(array &$queried_entities) { - $entity_class = $this->entityInfo->getClass(); + $entity_class = $this->entityType->getClass(); $entity_class::postLoad($this, $queried_entities); // Call hook_entity_load(). foreach ($this->moduleHandler()->getImplementations('entity_load') as $module) { $function = $module . '_entity_load'; - $function($queried_entities, $this->entityType); + $function($queried_entities, $this->entityTypeId); } // Call hook_TYPE_load(). - foreach ($this->moduleHandler()->getImplementations($this->entityType . '_load') as $module) { - $function = $module . '_' . $this->entityType . '_load'; + foreach ($this->moduleHandler()->getImplementations($this->entityTypeId . '_load') as $module) { + $function = $module . '_' . $this->entityTypeId . '_load'; $function($queried_entities); } } @@ -196,7 +194,7 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value */ public function loadByProperties(array $values = array()) { // 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); $result = $entity_query->execute(); return $result ? $this->loadMultiple($result) : array(); diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php index fb19c4e..69bb693 100644 --- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php +++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php @@ -24,14 +24,14 @@ class EntityViewBuilder extends EntityControllerBase implements EntityController * * @var string */ - protected $entityType; + protected $entityTypeId; /** - * The entity info array. + * Information about the entity type. * * @var \Drupal\Core\Entity\EntityTypeInterface */ - protected $entityInfo; + protected $entityType; /** * The entity manager service. @@ -68,8 +68,8 @@ class EntityViewBuilder extends EntityControllerBase implements EntityController * The language manager. */ public function __construct(EntityTypeInterface $entity_info, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) { - $this->entityType = $entity_info->id(); - $this->entityInfo = $entity_info; + $this->entityTypeId = $entity_info->id(); + $this->entityType = $entity_info; $this->entityManager = $entity_manager; $this->languageManager = $language_manager; } @@ -89,7 +89,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * {@inheritdoc} */ public function buildContent(array $entities, array $displays, $view_mode, $langcode = NULL) { - field_attach_prepare_view($this->entityType, $entities, $displays, $langcode); + field_attach_prepare_view($this->entityTypeId, $entities, $displays, $langcode); // Initialize the field item attributes for the fields set to be displayed. foreach ($entities as $entity) { @@ -108,7 +108,7 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang } } - module_invoke_all('entity_prepare_view', $this->entityType, $entities, $displays, $view_mode); + module_invoke_all('entity_prepare_view', $this->entityTypeId, $entities, $displays, $view_mode); foreach ($entities as $entity) { // Remove previously built content, if exists. @@ -134,22 +134,22 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang */ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) { $return = array( - '#theme' => $this->entityType, - "#{$this->entityType}" => $entity, + '#theme' => $this->entityTypeId, + "#{$this->entityTypeId}" => $entity, '#view_mode' => $view_mode, '#langcode' => $langcode, ); // Cache the rendered output if permitted by the view mode and global entity // type configuration. - if ($this->isViewModeCacheable($view_mode) && !$entity->isNew() && !isset($entity->in_preview) && $this->entityInfo->isRenderCacheable()) { + if ($this->isViewModeCacheable($view_mode) && !$entity->isNew() && !isset($entity->in_preview) && $this->entityType->isRenderCacheable()) { $return['#cache'] = array( - 'keys' => array('entity_view', $this->entityType, $entity->id(), $view_mode), + 'keys' => array('entity_view', $this->entityTypeId, $entity->id(), $view_mode), 'granularity' => DRUPAL_CACHE_PER_ROLE, 'bin' => $this->cacheBin, 'tags' => array( - $this->entityType . '_view' => TRUE, - $this->entityType => array($entity->id()), + $this->entityTypeId . '_view' => TRUE, + $this->entityTypeId => array($entity->id()), ), ); } @@ -219,7 +219,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la $this->buildContent($view_mode_entities, $displays[$mode], $mode, $langcode); } - $view_hook = "{$this->entityType}_view"; + $view_hook = "{$this->entityTypeId}_view"; $build = array('#sorted' => TRUE); $weight = 0; foreach ($entities as $key => $entity) { @@ -259,13 +259,13 @@ public function resetCache(array $entities = NULL) { $tags = array(); foreach ($entities as $entity) { $id = $entity->id(); - $tags[$this->entityType][$id] = $id; - $tags[$this->entityType . '_view_' . $entity->bundle()] = TRUE; + $tags[$this->entityTypeId][$id] = $id; + $tags[$this->entityTypeId . '_view_' . $entity->bundle()] = TRUE; } Cache::deleteTags($tags); } else { - Cache::deleteTags(array($this->entityType . '_view' => TRUE)); + Cache::deleteTags(array($this->entityTypeId . '_view' => TRUE)); } } @@ -283,7 +283,7 @@ protected function isViewModeCacheable($view_mode) { // The 'default' is not an actual view mode. return TRUE; } - $view_modes_info = entity_get_view_modes($this->entityType); + $view_modes_info = entity_get_view_modes($this->entityTypeId); return !empty($view_modes_info[$view_mode]['cache']); } diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php index 30c13c8..9670529 100644 --- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php @@ -111,25 +111,25 @@ public function __construct(EntityTypeInterface $entity_info, Connection $databa $this->fieldInfo = $field_info; // Check if the entity type supports IDs. - if ($this->entityInfo->hasKey('id')) { - $this->idKey = $this->entityInfo->getKey('id'); + if ($this->entityType->hasKey('id')) { + $this->idKey = $this->entityType->getKey('id'); } // Check if the entity type supports UUIDs. - $this->uuidKey = $this->entityInfo->getKey('uuid'); + $this->uuidKey = $this->entityType->getKey('uuid'); // Check if the entity type supports revisions. - if ($this->entityInfo->hasKey('revision')) { - $this->revisionKey = $this->entityInfo->getKey('revision'); - $this->revisionTable = $this->entityInfo->getRevisionTable(); + if ($this->entityType->hasKey('revision')) { + $this->revisionKey = $this->entityType->getKey('revision'); + $this->revisionTable = $this->entityType->getRevisionTable(); } // Check if the entity type has a dedicated table for fields. - if ($data_table = $this->entityInfo->getDataTable()) { + if ($data_table = $this->entityType->getDataTable()) { $this->dataTable = $data_table; // Entity types having both revision and translation support should always // define a revision data table. - if ($this->revisionTable && $revision_data_table = $this->entityInfo->getRevisionDataTable()) { + if ($this->revisionTable && $revision_data_table = $this->entityType->getRevisionDataTable()) { $this->revisionDataTable = $revision_data_table; } } @@ -237,7 +237,7 @@ protected function mapFromStorageRecords(array $records) { if (!$this->dataTable) { $bundle = $this->bundleKey ? $record->{$this->bundleKey} : FALSE; // Turn the record into an entity class. - $entities[$id] = new $this->entityClass($entities[$id], $this->entityType, $bundle); + $entities[$id] = new $this->entityClass($entities[$id], $this->entityTypeId, $bundle); } } $this->attachPropertyData($entities); @@ -270,13 +270,13 @@ protected function attachPropertyData(array &$entities) { } $data = $query->execute(); - $field_definitions = \Drupal::entityManager()->getFieldDefinitions($this->entityType); + $field_definitions = \Drupal::entityManager()->getFieldDefinitions($this->entityTypeId); $translations = array(); if ($this->revisionDataTable) { - $data_column_names = array_flip(array_diff(drupal_schema_fields_sql($this->entityInfo->getRevisionDataTable()), drupal_schema_fields_sql($this->entityInfo->getBaseTable()))); + $data_column_names = array_flip(array_diff(drupal_schema_fields_sql($this->entityType->getRevisionDataTable()), drupal_schema_fields_sql($this->entityType->getBaseTable()))); } else { - $data_column_names = array_flip(drupal_schema_fields_sql($this->entityInfo->getDataTable())); + $data_column_names = array_flip(drupal_schema_fields_sql($this->entityType->getDataTable())); } foreach ($data as $values) { @@ -312,7 +312,7 @@ protected function attachPropertyData(array &$entities) { foreach ($entities as $id => $values) { $bundle = $this->bundleKey ? $values[$this->bundleKey][Language::LANGCODE_DEFAULT] : FALSE; // Turn the record into an entity class. - $entities[$id] = new $this->entityClass($values, $this->entityType, $bundle, array_keys($translations[$id])); + $entities[$id] = new $this->entityClass($values, $this->entityTypeId, $bundle, array_keys($translations[$id])); } } } @@ -396,9 +396,9 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value * A SelectQuery object for loading the entity. */ protected function buildQuery($ids, $revision_id = FALSE) { - $query = $this->database->select($this->entityInfo->getBaseTable(), 'base'); + $query = $this->database->select($this->entityType->getBaseTable(), 'base'); - $query->addTag($this->entityType . '_load_multiple'); + $query->addTag($this->entityTypeId . '_load_multiple'); if ($revision_id) { $query->join($this->revisionTable, 'revision', "revision.{$this->idKey} = base.{$this->idKey} AND revision.{$this->revisionKey} = :revisionId", array(':revisionId' => $revision_id)); @@ -408,11 +408,11 @@ protected function buildQuery($ids, $revision_id = FALSE) { } // Add fields from the {entity} table. - $entity_fields = drupal_schema_fields_sql($this->entityInfo->getBaseTable()); + $entity_fields = drupal_schema_fields_sql($this->entityType->getBaseTable()); if ($this->revisionTable) { // Add all fields from the {entity_revision} table. - $entity_revision_fields = drupal_map_assoc(drupal_schema_fields_sql($this->entityInfo->getRevisionTable())); + $entity_revision_fields = drupal_map_assoc(drupal_schema_fields_sql($this->entityType->getRevisionTable())); // The ID field is provided by entity, so remove it. unset($entity_revision_fields[$this->idKey]); @@ -459,7 +459,7 @@ protected function postLoad(array &$queried_entities) { $queried_entities = $this->mapFromStorageRecords($queried_entities); // Attach field values. - if ($this->entityInfo->isFieldable()) { + if ($this->entityType->isFieldable()) { $this->loadFieldItems($queried_entities); } @@ -485,7 +485,7 @@ public function delete(array $entities) { } $ids = array_keys($entities); - $this->database->delete($this->entityInfo->getBaseTable()) + $this->database->delete($this->entityType->getBaseTable()) ->condition($this->idKey, $ids) ->execute(); @@ -524,7 +524,7 @@ public function delete(array $entities) { } catch (\Exception $e) { $transaction->rollback(); - watchdog_exception($this->entityType, $e); + watchdog_exception($this->entityTypeId, $e); throw new EntityStorageException($e->getMessage(), $e->getCode(), $e); } } @@ -540,7 +540,7 @@ public function save(EntityInterface $entity) { // Load the stored entity, if any. if (!$entity->isNew() && !isset($entity->original)) { - $entity->original = entity_load_unchanged($this->entityType, $entity->id()); + $entity->original = entity_load_unchanged($this->entityTypeId, $entity->id()); } $entity->preSave($this); @@ -552,7 +552,7 @@ public function save(EntityInterface $entity) { if (!$entity->isNew()) { if ($entity->isDefaultRevision()) { - $return = drupal_write_record($this->entityInfo->getBaseTable(), $record, $this->idKey); + $return = drupal_write_record($this->entityType->getBaseTable(), $record, $this->idKey); } else { // @todo, should a different value be returned when saving an entity @@ -582,7 +582,7 @@ public function save(EntityInterface $entity) { // Ensure the entity is still seen as new after assigning it an id, // while storing its data. $entity->enforceIsNew(); - $return = drupal_write_record($this->entityInfo->getBaseTable(), $record); + $return = drupal_write_record($this->entityType->getBaseTable(), $record); $entity->{$this->idKey}->value = (string) $record->{$this->idKey}; if ($this->revisionTable) { $entity->setNewRevision(); @@ -613,7 +613,7 @@ public function save(EntityInterface $entity) { } catch (\Exception $e) { $transaction->rollback(); - watchdog_exception($this->entityType, $e); + watchdog_exception($this->entityTypeId, $e); throw new EntityStorageException($e->getMessage(), $e->getCode(), $e); } } @@ -628,7 +628,7 @@ public function save(EntityInterface $entity) { * 'data_table'. */ protected function savePropertyData(EntityInterface $entity, $table_key = 'data_table') { - $table_name = $this->entityInfo->get($table_key); + $table_name = $this->entityType->get($table_key); $revision = $table_key != 'data_table'; if (!$revision || !$entity->isNewRevision()) { @@ -670,11 +670,11 @@ protected function mapToStorageRecord(EntityInterface $entity, $table_key = 'bas $record = new \stdClass(); $values = array(); $definitions = $entity->getPropertyDefinitions(); - $schema = drupal_get_schema($this->entityInfo->get($table_key)); + $schema = drupal_get_schema($this->entityType->get($table_key)); $is_new = $entity->isNew(); $multi_column_fields = array(); - foreach (drupal_schema_fields_sql($this->entityInfo->get($table_key)) as $name) { + foreach (drupal_schema_fields_sql($this->entityType->get($table_key)) as $name) { // Check for fields which store data in multiple columns and process them // separately. if ($field = strstr($name, '__', TRUE)) { @@ -751,7 +751,7 @@ protected function saveRevision(EntityInterface $entity) { if ($entity->isNewRevision()) { drupal_write_record($this->revisionTable, $record); if ($entity->isDefaultRevision()) { - $this->database->update($this->entityInfo->getBaseTable()) + $this->database->update($this->entityType->getBaseTable()) ->fields(array($this->revisionKey => $record->{$this->revisionKey})) ->condition($this->idKey, $record->{$this->idKey}) ->execute(); @@ -793,7 +793,7 @@ protected function doLoadFieldItems($entities, $age) { // Collect impacted fields. $fields = array(); foreach ($bundles as $bundle => $v) { - foreach ($this->fieldInfo->getBundleInstances($this->entityType, $bundle) as $field_name => $instance) { + foreach ($this->fieldInfo->getBundleInstances($this->entityTypeId, $bundle) as $field_name => $instance) { $fields[$field_name] = $instance->getField(); } } @@ -1103,7 +1103,7 @@ public function onBundleRename($bundle, $bundle_new) { // We need to account for deleted fields and instances. The method runs // before the instance definitions are updated, so we need to fetch them // using the old bundle name. - $instances = entity_load_multiple_by_properties('field_instance', array('entity_type' => $this->entityType, 'bundle' => $bundle, 'include_deleted' => TRUE)); + $instances = entity_load_multiple_by_properties('field_instance', array('entity_type' => $this->entityTypeId, 'bundle' => $bundle, 'include_deleted' => TRUE)); foreach ($instances as $instance) { $field = $instance->getField(); $table_name = static::_fieldTableName($field); diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php index 7dc7be2..d400e30 100644 --- a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php +++ b/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php @@ -39,8 +39,8 @@ public function __construct(EntityTypeInterface $entity_info) { parent::__construct($entity_info); - $this->bundleKey = $this->entityInfo->getKey('bundle'); - $this->entityClass = $this->entityInfo->getClass(); + $this->bundleKey = $this->entityType->getKey('bundle'); + $this->entityClass = $this->entityType->getClass(); } /** @@ -56,18 +56,18 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * {@inheritdoc} */ public function create(array $values) { - $entity_class = $this->entityInfo->getClass(); + $entity_class = $this->entityType->getClass(); $entity_class::preCreate($this, $values); // We have to determine the bundle first. $bundle = FALSE; if ($this->bundleKey) { if (!isset($values[$this->bundleKey])) { - throw new EntityStorageException(String::format('Missing bundle for entity type @type', array('@type' => $this->entityType))); + throw new EntityStorageException(String::format('Missing bundle for entity type @type', array('@type' => $this->entityTypeId))); } $bundle = $values[$this->bundleKey]; } - $entity = new $entity_class(array(), $this->entityType, $bundle); + $entity = new $entity_class(array(), $this->entityTypeId, $bundle); foreach ($entity as $name => $field) { if (isset($values[$name])) { @@ -121,7 +121,7 @@ protected function loadFieldItems(array $entities) { // Only the most current revision of non-deleted fields for cacheable entity // types can be cached. $load_current = $age == static::FIELD_LOAD_CURRENT; - $use_cache = $load_current && $this->entityInfo->isFieldDataCacheable(); + $use_cache = $load_current && $this->entityType->isFieldDataCacheable(); // Assume all entities will need to be queried. Entities found in the cache // will be removed from the list. @@ -132,13 +132,13 @@ protected function loadFieldItems(array $entities) { // Build the list of cache entries to retrieve. $cids = array(); foreach ($entities as $id => $entity) { - $cids[] = "field:{$this->entityType}:$id"; + $cids[] = "field:{$this->entityTypeId}:$id"; } $cache = cache('field')->getMultiple($cids); // Put the cached field values back into the entities and remove them from // the list of entities to query. foreach ($entities as $id => $entity) { - $cid = "field:{$this->entityType}:$id"; + $cid = "field:{$this->entityTypeId}:$id"; if (isset($cache[$cid])) { unset($queried_entities[$id]); foreach ($cache[$cid]->data as $langcode => $values) { @@ -182,7 +182,7 @@ protected function loadFieldItems(array $entities) { } } } - $cid = "field:{$this->entityType}:$id"; + $cid = "field:{$this->entityTypeId}:$id"; cache('field')->set($cid, $data); } } diff --git a/core/lib/Drupal/Core/Entity/Query/QueryBase.php b/core/lib/Drupal/Core/Entity/Query/QueryBase.php index 9122bab..3ba51ec 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryBase.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryBase.php @@ -20,7 +20,7 @@ * * @var string */ - protected $entityType; + protected $entityTypeId; /** * The list of sorts. @@ -129,7 +129,7 @@ * Constructs this object. */ public function __construct($entity_type, $conjunction, array $namespaces) { - $this->entityType = $entity_type; + $this->entityTypeId = $entity_type; $this->conjunction = $conjunction; $this->namespaces = $namespaces; $this->condition = $this->conditionGroupFactory($conjunction); @@ -142,7 +142,7 @@ public function __construct($entity_type, $conjunction, array $namespaces) { * Implements \Drupal\Core\Entity\Query\QueryInterface::getEntityType(). */ public function getEntityType() { - return $this->entityType; + return $this->entityTypeId; } /** diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Query.php b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php index f5c84b4..15be9ce 100644 --- a/core/lib/Drupal/Core/Entity/Query/Sql/Query.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php @@ -24,7 +24,7 @@ class Query extends QueryBase implements QueryInterface { * * @var \Drupal\Core\Entity\EntityTypeInterface */ - protected $entityInfo; + protected $entityType; /** * The build sql select query. @@ -107,20 +107,20 @@ public function execute() { * Returns the called object. */ protected function prepare() { - $entity_type = $this->entityType; - $this->entityInfo = $this->entityManager->getDefinition($entity_type); - if (!$base_table = $this->entityInfo->getBaseTable()) { + $entity_type = $this->entityTypeId; + $this->entityType = $this->entityManager->getDefinition($entity_type); + if (!$base_table = $this->entityType->getBaseTable()) { throw new QueryException("No base table, invalid query."); } $simple_query = TRUE; - if ($this->entityInfo->getDataTable()) { + if ($this->entityType->getDataTable()) { $simple_query = FALSE; } $this->sqlQuery = $this->connection->select($base_table, 'base_table', array('conjunction' => $this->conjunction)); $this->sqlQuery->addMetaData('entity_type', $entity_type); - $id_field = $this->entityInfo->getKey('id'); + $id_field = $this->entityType->getKey('id'); // Add the key field for fetchAllKeyed(). - if (!$revision_field = $this->entityInfo->getKey('revision')) { + if (!$revision_field = $this->entityType->getKey('revision')) { // When there is no revision support, the key field is the entity key. $this->sqlFields["base_table.$id_field"] = array('base_table', $id_field); // Now add the value column for fetchAllKeyed(). This is always the @@ -138,7 +138,7 @@ protected function prepare() { $this->sqlQuery->addTag($entity_type . '_access'); } $this->sqlQuery->addTag('entity_query'); - $this->sqlQuery->addTag('entity_query_' . $this->entityType); + $this->sqlQuery->addTag('entity_query_' . $this->entityTypeId); // Add further tags added. if (isset($this->alterTags)) { diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index da7cbaa..11503ed 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -97,7 +97,7 @@ public function load() { $entities = _block_rehash($this->theme); // Sort the blocks using \Drupal\block\Entity\Block::sort(). - uasort($entities, array($this->entityInfo->getClass(), 'sort')); + uasort($entities, array($this->entityType->getClass(), 'sort')); return $entities; } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php index 65f53da..fbbc469 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -20,14 +20,14 @@ class ContentTranslationController implements ContentTranslationControllerInterf * * @var string */ - protected $entityType; + protected $entityTypeId; /** - * The entity info of the entity being translated. + * Information about the entity type. * * @var \Drupal\Core\Entity\EntityTypeInterface */ - protected $entityInfo; + protected $entityType; /** * Initializes an instance of the content translation controller. @@ -36,8 +36,8 @@ class ContentTranslationController implements ContentTranslationControllerInterf * The info array of the given entity type. */ public function __construct($entity_info) { - $this->entityType = $entity_info->id(); - $this->entityInfo = $entity_info; + $this->entityTypeId = $entity_info->id(); + $this->entityType = $entity_info; } /** diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php index 062b3ad..d904af2 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php @@ -19,11 +19,11 @@ class EntityDisplayModeListController extends ConfigEntityListController { /** - * The entity info for all entity types. + * All entity types. * * @var \Drupal\Core\Entity\EntityTypeInterface[] */ - protected $entityInfoComplete; + protected $entityTypes; /** * Constructs a new EntityListController object. @@ -38,7 +38,7 @@ class EntityDisplayModeListController extends ConfigEntityListController { public function __construct(EntityTypeInterface $entity_info, EntityStorageControllerInterface $storage, array $entity_info_complete) { parent::__construct($entity_info, $storage); - $this->entityInfoComplete = $entity_info_complete; + $this->entityTypes = $entity_info_complete; } /** @@ -86,17 +86,17 @@ public function load() { public function render() { $build = array(); foreach ($this->load() as $entity_type => $entities) { - if (!isset($this->entityInfoComplete[$entity_type])) { + if (!isset($this->entityTypes[$entity_type])) { continue; } // Filter entities - if ($this->entityInfoComplete[$entity_type]->isFieldable() && !$this->isValidEntity($entity_type)) { + if ($this->entityTypes[$entity_type]->isFieldable() && !$this->isValidEntity($entity_type)) { continue; } $table = array( - '#prefix' => '