BaseFieldDefinition::setDefaultValueCallback

public BaseFieldDefinition::setDefaultValueCallback($callback) File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 498 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function setDefaultValueCallback($callback) { if (isset($callback) && !is_string($callback)) { throw new \InvalidArgumentException('Default value callback must be a string, like "function_name" or "ClassName::methodName"'); } $this->defin

BaseFieldDefinition::setDefaultValue

public BaseFieldDefinition::setDefaultValue($value) File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 478 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function setDefaultValue($value) { if ($value === NULL) { $value = []; } // Unless the value is an empty array, we may need to transform it. if (!is_array($value) || !empty($value)) { if (!is_array($value)) { $value = array(array($this->getMainP

BaseFieldDefinition::setCustomStorage

public BaseFieldDefinition::setCustomStorage($custom_storage) Sets the storage behavior for this field. Parameters bool $custom_storage: Pass FALSE if the storage takes care of storing the field, TRUE otherwise. Return value $this Throws \LogicException Thrown if custom storage is to be set to FALSE for a computed field. File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 693 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code pub

BaseFieldDefinition::setCardinality

public BaseFieldDefinition::setCardinality($cardinality) Sets the maximum number of items allowed for the field. Possible values are positive integers or FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED. Parameters int $cardinality: The field cardinality. Return value $this File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 273 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function setCardinality($cardinality) {

BaseFieldDefinition::isTranslatable

public BaseFieldDefinition::isTranslatable() Returns whether the field is translatable. Return value bool TRUE if the field is translatable. Overrides FieldDefinitionInterface::isTranslatable File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 215 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function isTranslatable() { return !empty($this->definition['translatable']); }

BaseFieldDefinition::isRevisionable

public BaseFieldDefinition::isRevisionable() Returns whether the field is revisionable. Return value bool TRUE if the field is revisionable. Overrides FieldStorageDefinitionInterface::isRevisionable File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 236 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function isRevisionable() { return !empty($this->definition['revisionable']); }

BaseFieldDefinition::isQueryable

public BaseFieldDefinition::isQueryable() Determines whether the field is queryable via QueryInterface. Return value bool TRUE if the field is queryable. Overrides FieldStorageDefinitionInterface::isQueryable File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 289 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function isQueryable() { return isset($this->definition['queryable']) ? $this->definition['queryable'] :

BaseFieldDefinition::isMultiple

public BaseFieldDefinition::isMultiple() Returns whether the field can contain multiple items. Return value bool TRUE if the field can contain multiple items, FALSE otherwise. Overrides FieldStorageDefinitionInterface::isMultiple File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 281 Class BaseFieldDefinition A class for defining entity fields. Namespace Drupal\Core\Field Code public function isMultiple() { $cardinality = $this->getCardinality(); return ($cardinality

BaseFieldDefinition::isDisplayConfigurable

public BaseFieldDefinition::isDisplayConfigurable($display_context) Returns whether the display for the field can be configured. Parameters string $display_context: The display context. Either 'view' or 'form'. Return value bool TRUE if the display for this field is configurable in the given context. If TRUE, the display options returned by getDisplayOptions() may be overridden via the respective entity display. Overrides FieldDefinitionInterface::isDisplayConfigurable See also \Drupal\Core\

BaseFieldDefinition::isBaseField

public BaseFieldDefinition::isBaseField() Determines whether the field is a base field. Base fields are not specific to a given bundle or a set of bundles. This excludes configurable fields, as they are always attached to a specific bundle. Return value bool Whether the field is a base field. Overrides FieldStorageDefinitionInterface::isBaseField File core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 677 Class BaseFieldDefinition A class for defining entity fields. Namespace Dru