summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2017-03-01 10:12:04 +0000
committerNathaniel Catchpole2017-03-01 10:12:04 +0000
commit5071f6d92db78c1849102cbd9fc7d09dba821bab (patch)
treef51a19cee2ee74f7d8ffda3829afb444b1edf8cc
parentbad2d57bbd21a140066a397121e0efa5677ade5a (diff)
Issue #2855886 by arshadcn, himanshu-dixit, amateescu: Deprecate \Drupal\Core\Field\FieldStorageDefinitionInterface::isQueryable() because it's not used anywhere
-rw-r--r--core/lib/Drupal/Core/Field/BaseFieldDefinition.php10
-rw-r--r--core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php6
-rw-r--r--core/modules/node/src/Entity/Node.php2
3 files changed, 14 insertions, 4 deletions
diff --git a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php
index 2ff6716..e703b38 100644
--- a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php
+++ b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php
@@ -89,7 +89,6 @@ class BaseFieldDefinition extends ListDataDefinition implements FieldDefinitionI
->setLabel($definition->getLabel())
->setName($definition->getName())
->setProvider($definition->getProvider())
- ->setQueryable($definition->isQueryable())
->setRevisionable($definition->isRevisionable())
->setSettings($definition->getSettings())
->setTargetEntityTypeId($definition->getTargetEntityTypeId())
@@ -287,7 +286,8 @@ class BaseFieldDefinition extends ListDataDefinition implements FieldDefinitionI
* {@inheritdoc}
*/
public function isQueryable() {
- return isset($this->definition['queryable']) ? $this->definition['queryable'] : !$this->isComputed();
+ @trigger_error('BaseFieldDefinition::isQueryable() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Field\BaseFieldDefinition::hasCustomStorage(). See https://www.drupal.org/node/2856563.', E_USER_DEPRECATED);
+ return !$this->hasCustomStorage();
}
/**
@@ -298,8 +298,14 @@ class BaseFieldDefinition extends ListDataDefinition implements FieldDefinitionI
*
* @return static
* The object itself for chaining.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use
+ * \Drupal\Core\Field\BaseFieldDefinition::setCustomStorage() instead.
+ *
+ * @see https://www.drupal.org/node/2856563
*/
public function setQueryable($queryable) {
+ @trigger_error('BaseFieldDefinition::setQueryable() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Field\BaseFieldDefinition::setCustomStorage(). See https://www.drupal.org/node/2856563.', E_USER_DEPRECATED);
$this->definition['queryable'] = $queryable;
return $this;
}
diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php
index 1b842b9..d703659 100644
--- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php
+++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php
@@ -109,6 +109,12 @@ interface FieldStorageDefinitionInterface extends CacheableDependencyInterface {
*
* @return bool
* TRUE if the field is queryable.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use
+ * \Drupal\Core\Field\FieldStorageDefinitionInterface::hasCustomStorage()
+ * instead.
+ *
+ * @see https://www.drupal.org/node/2856563
*/
public function isQueryable();
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index 13192cf..263f7c8 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -458,14 +458,12 @@ class Node extends ContentEntityBase implements NodeInterface {
$fields['revision_timestamp'] = BaseFieldDefinition::create('created')
->setLabel(t('Revision timestamp'))
->setDescription(t('The time that the current revision was created.'))
- ->setQueryable(FALSE)
->setRevisionable(TRUE);
$fields['revision_uid'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Revision user ID'))
->setDescription(t('The user ID of the author of the current revision.'))
->setSetting('target_type', 'user')
- ->setQueryable(FALSE)
->setRevisionable(TRUE);
$fields['revision_log'] = BaseFieldDefinition::create('string_long')