public function BaseFieldDefinition::isStorageRequired in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::isStorageRequired()
Returns whether the field storage is required.
If a field storage is required, NOT NULL constraints will be added automatically for the required properties of a field type.
Return value
bool TRUE if the field storage is required, FALSE otherwise.
Overrides RequiredFieldStorageDefinitionInterface::isStorageRequired
File
- core/
lib/ Drupal/ Core/ Field/ BaseFieldDefinition.php, line 789
Class
- BaseFieldDefinition
- A class for defining entity fields.
Namespace
Drupal\Core\FieldCode
public function isStorageRequired() {
if (isset($this->definition['storage_required'])) {
return (bool) $this->definition['storage_required'];
}
// Default to the 'required' property of the base field.
return $this
->isRequired();
}