diff --git a/core/lib/Drupal/Core/Field/FieldConfigBase.php b/core/lib/Drupal/Core/Field/FieldConfigBase.php index fa34ca3..e25d94f 100644 --- a/core/lib/Drupal/Core/Field/FieldConfigBase.php +++ b/core/lib/Drupal/Core/Field/FieldConfigBase.php @@ -146,7 +146,7 @@ * * @var array */ - public $default_value = array(); + protected $default_value = array(); /** * The name of a callback function that returns default values. diff --git a/core/lib/Drupal/Core/Field/FieldConfigInterface.php b/core/lib/Drupal/Core/Field/FieldConfigInterface.php index ae45a21..11da0df 100644 --- a/core/lib/Drupal/Core/Field/FieldConfigInterface.php +++ b/core/lib/Drupal/Core/Field/FieldConfigInterface.php @@ -77,6 +77,23 @@ public function setSettings(array $settings); public function setSetting($setting_name, $value); /** + * Sets whether the field can be empty. + * + * If a field is required, an entity needs to have at least a valid, + * non-empty item in that field's FieldItemList in order to pass validation. + * + * An item is considered empty if its isEmpty() method returns TRUE. + * Typically, that is if at least one of its required properties is empty. + * + * @param bool $required + * TRUE if the field is required. FALSE otherwise. + * + * @return $this + * The current object, for a fluent interface. + */ + public function setRequired($required); + + /** * Sets a default value. * * Note that if a default value callback is set, it will take precedence over diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php index 8e9391b..5e00f7e 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php @@ -160,42 +160,6 @@ public function isDisplayConfigurable($display_context); public function getDisplayOptions($display_context); /** - * Returns whether the field can be empty. - * - * If a field is required, an entity needs to have at least a valid, - * non-empty item in that field's FieldItemList in order to pass validation. - * - * An item is considered empty if its isEmpty() method returns TRUE. - * Typically, that is if at least one of its required properties is empty. - * - * @return bool - * TRUE if the field is required. - * - * @see \Drupal\Core\TypedData\Plugin\DataType\ItemList::isEmpty() - * @see \Drupal\Core\Field\FieldItemInterface::isEmpty() - * @see \Drupal\Core\TypedData\DataDefinitionInterface:isRequired() - * @see \Drupal\Core\TypedData\TypedDataManager::getDefaultConstraints() - */ - public function isRequired(); - - /** - * Set whether the field can be empty. - * - * If a field is required, an entity needs to have at least a valid, - * non-empty item in that field's FieldItemList in order to pass validation. - * - * An item is considered empty if its isEmpty() method returns TRUE. - * Typically, that is if at least one of its required properties is empty. - * - * @param bool $required - * TRUE if the field is required. FALSE otherwise. - * - * @return $this - * The current object, for a fluent interface. - */ - public function setRequired($required); - - /** * Returns the default value for the field in a newly created entity. * * @param \Drupal\Core\Entity\FieldableEntityInterface $entity