public property FieldInstance::$required

Flag indicating whether the field is required.

TRUE if a value for this field is required when used with this bundle, FALSE otherwise. Currently, required-ness is only enforced at the Form API level in entity edit forms, not during direct API saves.

Type: bool

File

drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php, line 120
Contains \Drupal\field\Plugin\Core\Entity\FieldInstance.

Class

FieldInstance
Defines the Field instance entity.

Namespace

Drupal\field\Plugin\Core\Entity

Code

public $required = FALSE;