Commit 5071f6d9 authored by catch's avatar catch

Issue #2855886 by arshadcn, himanshu-dixit, amateescu: Deprecate...

Issue #2855886 by arshadcn, himanshu-dixit, amateescu: Deprecate \Drupal\Core\Field\FieldStorageDefinitionInterface::isQueryable() because it's not used anywhere
parent bad2d57b
......@@ -89,7 +89,6 @@ public static function createFromFieldStorageDefinition(FieldStorageDefinitionIn
->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 @@ public function isMultiple() {
* {@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 @@ public function isQueryable() {
*
* @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;
}
......
......@@ -109,6 +109,12 @@ public function isRevisionable();
*
* @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();
......
......@@ -458,14 +458,12 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment