Drupal 8  8.0.2
FieldStorageConfig Class Reference
Inheritance diagram for FieldStorageConfig:

Public Member Functions

 __construct (array $values, $entity_type= 'field_storage_config')
 
 id ()
 
 preSave (EntityStorageInterface $storage)
 
 calculateDependencies ()
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 getSchema ()
 
 hasCustomStorage ()
 
 isBaseField ()
 
 getColumns ()
 
 getBundles ()
 
 getName ()
 
 isDeleted ()
 
 getTypeProvider ()
 
 getType ()
 
 getSettings ()
 
 getSetting ($setting_name)
 
 setSetting ($setting_name, $value)
 
 setSettings (array $settings)
 
 isTranslatable ()
 
 isRevisionable ()
 
 setTranslatable ($translatable)
 
 getProvider ()
 
 getLabel ()
 
 getDescription ()
 
 getCardinality ()
 
 setCardinality ($cardinality)
 
 getOptionsProvider ($property_name, FieldableEntityInterface $entity)
 
 isMultiple ()
 
 isLocked ()
 
 setLocked ($locked)
 
 getTargetEntityTypeId ()
 
 isQueryable ()
 
 hasData ()
 
 __sleep ()
 
 getConstraints ()
 
 getConstraint ($constraint_name)
 
 getPropertyDefinition ($name)
 
 getPropertyDefinitions ()
 
 getPropertyNames ()
 
 getMainPropertyName ()
 
 getUniqueStorageIdentifier ()
 
 isDeletable ()
 
 getIndexes ()
 
 setIndexes (array $indexes)
 
- Public Member Functions inherited from ConfigEntityBase
 __construct (array $values, $entity_type)
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 isNew ()
 
 get ($property_name)
 
 set ($property_name, $value)
 
 enable ()
 
 disable ()
 
 setStatus ($status)
 
 status ()
 
 setSyncing ($syncing)
 
 isSyncing ()
 
 setUninstalling ($uninstalling)
 
 isUninstalling ()
 
 createDuplicate ()
 
 preSave (EntityStorageInterface $storage)
 
 calculateDependencies ()
 
 urlInfo ($rel= 'edit-form', array $options=[])
 
 url ($rel= 'edit-form', $options=array())
 
 link ($text=NULL, $rel= 'edit-form', array $options=[])
 
 toUrl ($rel= 'edit-form', array $options=[])
 
 getCacheTagsToInvalidate ()
 
 getDependencies ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
 onDependencyRemoval (array $dependencies)
 
 setThirdPartySetting ($module, $key, $value)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 getThirdPartySettings ($module)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 
 isInstallable ()
 
 trustData ()
 
 hasTrustedData ()
 
 save ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 

Static Public Member Functions

static preDelete (EntityStorageInterface $storage, array $field_storages)
 
static postDelete (EntityStorageInterface $storage, array $fields)
 
static loadByName ($entity_type_id, $field_name)
 
- Static Public Member Functions inherited from ConfigEntityBase
static sort (ConfigEntityInterface $a, ConfigEntityInterface $b)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 

Data Fields

const NAME_MAX_LENGTH = 32
 
 $custom_storage = FALSE
 
- Data Fields inherited from FieldStorageDefinitionInterface
const CARDINALITY_UNLIMITED = -1
 

Protected Member Functions

 preSaveNew (EntityStorageInterface $storage)
 
 preSaveUpdated (EntityStorageInterface $storage)
 
 getFieldItemClass ()
 
- Protected Member Functions inherited from ConfigEntityBase
 getTypedConfig ()
 
 addDependency ($type, $name)
 
 invalidateTagsOnSave ($update)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 

Protected Attributes

 $id
 
 $field_name
 
 $entity_type
 
 $type
 
 $module
 
 $settings = []
 
 $cardinality = 1
 
 $translatable = TRUE
 
 $locked = FALSE
 
 $persist_with_no_fields = FALSE
 
 $indexes = []
 
 $deleted = FALSE
 
 $schema
 
 $propertyDefinitions
 
- Protected Attributes inherited from ConfigEntityBase
 $originalId
 
 $pluginConfigKey
 
 $status = TRUE
 
 $uuid
 
 $langcode = 'en'
 
 $third_party_settings = array()
 
 $_core = []
 
 $trustedData = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Static Protected Attributes

static $inDeletion = FALSE
 

Additional Inherited Members

- Static Protected Member Functions inherited from ConfigEntityBase
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
static getConfigManager ()
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 

Detailed Description

Defines the Field storage configuration entity.

( id = "field_storage_config", label = ("Field storage"), handlers = { "storage" = "Drupal\field\FieldStorageConfigStorage" }, config_prefix = "storage", entity_keys = { "id" = "id", "label" = "id" }, config_export = { "id", "field_name", "entity_type", "type", "settings", "module", "locked", "cardinality", "translatable", "indexes", "persist_with_no_fields", "custom_storage", } )

Constructor & Destructor Documentation

__construct ( array  $values,
  $entity_type = 'field_storage_config' 
)

Constructs a FieldStorageConfig object.

Parameters
array$valuesAn array of field properties, keyed by property name. Most array elements will be used to set the corresponding properties on the class; see the class property documentation for details. Some array elements have special meanings and a few are required. Special elements are:
  • name: required. As a temporary Backwards Compatibility layer right now, a 'field_name' property can be accepted in place of 'id'.
  • entity_type: required.
  • type: required.

In most cases, Field entities are created via entity_create('field_storage_config', $values)), where $values is the same parameter as in this constructor.

See Also
entity_create()

Member Function Documentation

__sleep ( )

Implements the magic __sleep() method.

Using the Serialize interface and serialize() / unserialize() methods breaks entity forms in PHP 5.4.

Todo:
Investigate in https://www.drupal.org/node/2074253.
calculateDependencies ( )

{Calculates dependencies and stores them in the dependency property.

Returns
$this
See Also
}

Implements ConfigEntityInterface.

References ConfigEntityBase\addDependency(), Drupal\entityManager(), FieldStorageConfig\getType(), FieldStorageConfig\getTypeProvider(), and Drupal\service().

Here is the call graph for this function:

getBundles ( )

{Returns the list of bundles where the field storage has fields.

Returns
array An array of bundle names.
}

Implements FieldStorageConfigInterface.

References Drupal\entityManager(), FieldStorageConfig\getName(), FieldStorageConfig\getTargetEntityTypeId(), and FieldStorageConfig\isDeleted().

Referenced by FieldStorageConfig\isDeletable().

Here is the call graph for this function:

Here is the caller graph for this function:

getCardinality ( )

{Returns the maximum number of items allowed for the field.Possible values are positive integers or FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED.

Returns
int The field cardinality.
}

Implements FieldStorageDefinitionInterface.

Referenced by FieldStorageConfig\isMultiple().

Here is the caller graph for this function:

getColumns ( )

{Returns the field columns, as defined in the field schema.

Returns
array[] The array of field columns, keyed by column name, in the same format returned by getSchema().
See Also
::getSchema()
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getSchema().

Here is the call graph for this function:

getConstraint (   $constraint_name)

{Returns a validation constraint.See ::getConstraints() for details.

Parameters
string$constraint_nameThe name of the constraint, i.e. its plugin id.
Returns
array A validation constraint definition which can be used for instantiating a object.
See Also
}

Implements FieldStorageDefinitionInterface.

getConstraints ( )

{Returns an array of validation constraints.See ::getConstraints() for details.

Returns
array[] An array of validation constraint definitions, keyed by constraint name. Each constraint definition can be used for instantiating objects.
See Also
}

Implements FieldStorageDefinitionInterface.

getDescription ( )

{Returns the human-readable description for the field.This is displayed in addition to the label in places where additional descriptive information is helpful. For example, as help text below the form element in entity edit forms.

Returns
string|null The field description, or NULL if no description is available.
}

Implements FieldStorageDefinitionInterface.

getFieldItemClass ( )
protected

Helper to retrieve the field item class.

References FieldStorageConfig\getType(), and Drupal\typedDataManager().

Referenced by FieldStorageConfig\getMainPropertyName(), FieldStorageConfig\getOptionsProvider(), FieldStorageConfig\getPropertyDefinitions(), and FieldStorageConfig\getSchema().

Here is the call graph for this function:

Here is the caller graph for this function:

getIndexes ( )

{Returns the custom storage indexes for the field data storage.

Returns
array An array of custom indexes.
}

Implements FieldStorageConfigInterface.

getLabel ( )

{Returns the human-readable label for the field.

Returns
string The field label.
}

Implements FieldStorageDefinitionInterface.

References Entity\label().

Here is the call graph for this function:

getMainPropertyName ( )

{Returns the name of the main property, if any.Some field items consist mainly of one main property, e.g. the value of a text field or the

target_id

of an entity reference. If the field item has no main property, the method returns NULL.

Returns
string|null The name of the value property, or NULL if there is none.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getFieldItemClass().

Here is the call graph for this function:

getName ( )

{Returns the machine name of the field.This defines how the field data is accessed from the entity. For example, if the field name is "foo", then $entity->foo returns its data.

Returns
string The field name.
}

Implements FieldStorageDefinitionInterface.

Referenced by FieldStorageConfig\getBundles(), FieldStorageConfig\getOptionsProvider(), FieldStorageConfig\id(), and FieldStorageConfig\preSaveNew().

Here is the caller graph for this function:

getOptionsProvider (   $property_name,
FieldableEntityInterface  $entity 
)

{Gets an options provider for the given field item property.

Parameters
string$property_nameThe name of the property to get options for; e.g., 'value'.
\Drupal\Core\Entity\FieldableEntityInterface$entityThe entity for which the options should be provided.
Returns
|null An options provider, or NULL if no options are defined.
}

Implements FieldStorageDefinitionInterface.

References FieldableEntityInterface\get(), FieldStorageConfig\getFieldItemClass(), and FieldStorageConfig\getName().

Here is the call graph for this function:

getPropertyDefinition (   $name)

{Gets the definition of a contained property.

Parameters
string$nameThe name of property.
Returns
|null The definition of the property or NULL if the property does not exist.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getPropertyDefinitions().

Here is the call graph for this function:

getPropertyDefinitions ( )

{Gets an array of property definitions of contained properties.

Returns
[] An array of property definitions of contained properties, keyed by property name.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getFieldItemClass().

Referenced by FieldStorageConfig\getPropertyDefinition(), and FieldStorageConfig\getPropertyNames().

Here is the call graph for this function:

Here is the caller graph for this function:

getPropertyNames ( )

{Returns the names of the field's subproperties.A field is a list of items, and each item can contain one or more properties. All items for a given field contain the same property names, but the values can be different for each item.For example, an email field might just contain a single 'value' property, while a link field might contain 'title' and 'url' properties, and a text field might contain 'value', 'summary', and 'format' properties.

Returns
string[] The property names.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getPropertyDefinitions().

Here is the call graph for this function:

getProvider ( )

{Returns the name of the provider of this field.

Returns
string The provider name; e.g., the module name.
}

Implements FieldStorageDefinitionInterface.

getSchema ( )

{Returns the field schema.Note that this method returns an empty array for computed fields which have no schema.

Returns
array[] The field schema, as an array of key/value pairs in the format returned by hook_field_schema():
  • columns: An array of Schema API column specifications, keyed by column name. This specifies what comprises a single value for a given field. No assumptions should be made on how storage backends internally use the original column name to structure their storage.
  • indexes: An array of Schema API index definitions. Some storage backends might not support indexes.
  • foreign keys: An array of Schema API foreign key definitions. Note, however, that depending on the storage backend specified for the field, the field data is not necessarily stored in SQL.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getFieldItemClass().

Referenced by FieldStorageConfig\getColumns().

Here is the call graph for this function:

Here is the caller graph for this function:

getSetting (   $setting_name)

{Returns the value of a given storage setting.

Parameters
string$setting_nameThe setting name.
Returns
mixed The setting value.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getSettings().

Here is the call graph for this function:

getSettings ( )

{Returns the storage settings.Each field type defines the settings that are meaningful for that type. For example, a text field can define a 'max_length' setting, and an image field can define a 'alt_field_required' setting.The method always returns an array of all available settings for this field type, possibly with the default values merged in if values have not been provided for all available settings.

Returns
mixed[] An array of key/value pairs.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageConfig\getType(), and Drupal\service().

Referenced by FieldStorageConfig\getSetting().

Here is the call graph for this function:

Here is the caller graph for this function:

getTargetEntityTypeId ( )

{Returns the ID of the entity type the field is attached to.This method should not be confused with EntityInterface::getEntityTypeId() (configurable fields are config entities, and thus implement both interfaces):

Returns
string The entity type ID.
}

Implements FieldStorageDefinitionInterface.

Referenced by FieldStorageConfig\getBundles(), FieldStorageConfig\id(), FieldStorageConfig\postSave(), and FieldStorageConfig\preSaveUpdated().

Here is the caller graph for this function:

getType ( )

{Returns the field type.

Returns
string The field type, i.e. the id of a field type plugin. For example 'text'.
}

Implements FieldStorageConfigInterface.

Referenced by FieldStorageConfig\calculateDependencies(), FieldStorageConfig\getFieldItemClass(), FieldStorageConfig\getSettings(), FieldStorageConfig\preSaveNew(), and FieldStorageConfig\preSaveUpdated().

Here is the caller graph for this function:

getTypeProvider ( )

{Returns the name of the module providing the field type.

Returns
string The name of the module that provides the field type.
}

Implements FieldStorageConfigInterface.

Referenced by FieldStorageConfig\calculateDependencies().

Here is the caller graph for this function:

getUniqueStorageIdentifier ( )

{Returns a unique identifier for the field.

Returns
string
}

Implements FieldStorageDefinitionInterface.

References Entity\uuid().

Here is the call graph for this function:

hasCustomStorage ( )

{Returns the storage behavior for this field.Indicates whether the entity type's storage should take care of storing the field values or whether it is handled separately; e.g. by the module providing the field.

Returns
bool FALSE if the storage takes care of storing the field, TRUE otherwise.
}

Implements FieldStorageDefinitionInterface.

hasData ( )

Determines whether a field has any data.

Returns
bool TRUE if the field has data for any entity; FALSE otherwise.
id ( )

{Gets the identifier.

Returns
string|int|null The entity identifier, or NULL if the object does not yet have an identifier.
}

Implements EntityInterface.

References FieldStorageConfig\getName(), and FieldStorageConfig\getTargetEntityTypeId().

Referenced by FieldStorageConfig\preSaveNew().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns
bool Whether the field is a base field.
}

Implements FieldStorageDefinitionInterface.

isDeletable ( )

{Checks if the field storage can be deleted.

Returns
bool TRUE if the field storage can be deleted.
}

Implements FieldStorageConfigInterface.

References FieldStorageConfig\getBundles().

Here is the call graph for this function:

isDeleted ( )

{Returns whether the field is deleted or not.

Returns
bool TRUE if the field is deleted.
}

Implements FieldStorageConfigInterface.

Referenced by FieldStorageConfig\getBundles().

Here is the caller graph for this function:

isLocked ( )

{Returns whether the field storage is locked or not.

Returns
bool TRUE if the field storage is locked.
}

Implements FieldStorageConfigInterface.

isMultiple ( )

{Returns whether the field can contain multiple items.

Returns
bool TRUE if the field can contain multiple items, FALSE otherwise.
}

Implements FieldStorageDefinitionInterface.

References FieldStorageDefinitionInterface\CARDINALITY_UNLIMITED, and FieldStorageConfig\getCardinality().

Here is the call graph for this function:

isQueryable ( )

{Determines whether the field is queryable via QueryInterface.

Returns
bool TRUE if the field is queryable.
}

Implements FieldStorageDefinitionInterface.

isRevisionable ( )

{Returns whether the field is revisionable.

Returns
bool TRUE if the field is revisionable.
}

Implements FieldStorageDefinitionInterface.

isTranslatable ( )

{Returns whether the field supports translation.

Returns
bool TRUE if the field supports translation.
}

Implements FieldStorageDefinitionInterface.

static loadByName (   $entity_type_id,
  $field_name 
)
static

Loads a field config entity based on the entity type and field name.

Parameters
string$entity_type_idID of the entity type.
string$field_nameName of the field.
Returns
static The field config entity if one exists for the provided field name, otherwise NULL.

Referenced by CommentManager\addBodyField(), ManageFieldsTest\addPersistentFieldStorage(), OptionsFieldUITest\assertAllowedValuesInput(), ManageFieldsTest\assertFieldSettings(), ConfigTranslationListUiTest\doFieldListTest(), Comment\preCreate(), ViewEntityDependenciesTest\setUp(), BlockContentFieldFilterTest\setUp(), NodeLanguageTest\setUp(), CommentFieldsTest\testCommentDefaultFields(), CommentFieldsTest\testCommentFieldDelete(), CommentFieldsTest\testCommentInstallAfterContentModule(), CommentTypeTest\testCommentTypeDeletion(), CommentUninstallTest\testCommentUninstallWithField(), CommentUninstallTest\testCommentUninstallWithoutField(), ManageFieldsTest\testDefaultValue(), FieldStorageCrudTest\testDelete(), FieldUIDeleteTest\testDeleteField(), ManageFieldsTest\testDeleteField(), ManageFieldsTest\testDeleteTaxonomyField(), EntityTranslationFormTest\testEntityFormLanguage(), NodeBodyFieldStorageTest\testFieldOverrides(), ForumUninstallTest\testForumUninstallWithField(), ForumUninstallTest\testForumUninstallWithoutFieldStorage(), OptionsFloatFieldImportTest\testImport(), ManageFieldsTest\testPreconfiguredFields(), TrackerTest\testTrackerAll(), and FileFieldTestBase\uploadNodeFiles().

Here is the caller graph for this function:

static postDelete ( EntityStorageInterface  $storage,
array  $fields 
)
static

{Acts on deleted entities before the delete hook is invoked.Used after the entities are deleted but before invoking the delete hook.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.
}

Implements EntityInterface.

References Drupal\entityManager().

Here is the call graph for this function:

postSave ( EntityStorageInterface  $storage,
  $update = TRUE 
)

{Acts on a saved entity before the insert or update hook is invoked.Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
bool$updateTRUE if the entity has been updated, or FALSE if it has been inserted.
}

Implements EntityInterface.

References Drupal\entityManager(), and FieldStorageConfig\getTargetEntityTypeId().

Here is the call graph for this function:

static preDelete ( EntityStorageInterface  $storage,
array  $field_storages 
)
static

{Acts on entities before they are deleted and before hooks are invoked.Used before the entities are deleted and before invoking the delete hook.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage object.
\Drupal\Core\Entity\EntityInterface[]$entities An array of entities.
}

Implements EntityInterface.

References Drupal\state().

Here is the call graph for this function:

preSave ( EntityStorageInterface  $storage)

Overrides ::preSave().

Exceptions
\Drupal\Core\Field\FieldExceptionIf the field definition is invalid.
\Drupal\Core\Entity\EntityStorageExceptionIn case of failures at the configuration storage level.

Implements EntityInterface.

References ConfigEntityBase\isNew(), FieldStorageConfig\preSaveNew(), FieldStorageConfig\preSaveUpdated(), and Drupal\service().

Here is the call graph for this function:

preSaveNew ( EntityStorageInterface  $storage)
protected

Prepares saving a new field definition.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage.
Exceptions
\Drupal\Core\Field\FieldExceptionIf the field definition is invalid.

References Drupal\entityManager(), FieldStorageConfig\getName(), FieldStorageConfig\getType(), FieldStorageConfig\id(), Drupal\service(), and Unicode\strlen().

Referenced by FieldStorageConfig\preSave().

Here is the call graph for this function:

Here is the caller graph for this function:

preSaveUpdated ( EntityStorageInterface  $storage)
protected

Prepares saving an updated field definition.

Parameters
\Drupal\Core\Entity\EntityStorageInterface$storageThe entity storage.

References Drupal\entityManager(), FieldStorageConfig\getTargetEntityTypeId(), FieldStorageConfig\getType(), and Drupal\moduleHandler().

Referenced by FieldStorageConfig\preSave().

Here is the call graph for this function:

Here is the caller graph for this function:

setCardinality (   $cardinality)

{Sets the maximum number of items allowed for the field.

Parameters
int$cardinalityThe cardinality value.
Returns
$this
}

Implements FieldStorageConfigInterface.

setIndexes ( array  $indexes)

{Sets the custom storage indexes for the field data storage..

Parameters
array$indexesThe array of custom indexes.
Returns
$this
}

Implements FieldStorageConfigInterface.

setLocked (   $locked)

{Sets the locked flag.

Parameters
bool$lockedSets value of locked flag.
Returns
$this
}

Implements FieldStorageConfigInterface.

setSetting (   $setting_name,
  $value 
)

{Sets the value for a field setting by name.

Parameters
string$setting_nameThe name of the setting.
mixed$valueThe value of the setting.
Returns
$this
}

Implements FieldStorageConfigInterface.

setSettings ( array  $settings)

{Sets field storage settings.Note that the method does not unset existing settings not specified in the incoming $settings array.For example:

// Given these are the default settings.
$storage_definition->getSettings() === [
'fruit' => 'apple',
'season' => 'summer',
];
// Change only the 'fruit' setting.
$storage_definition->setSettings(['fruit' => 'banana']);
// The 'season' setting persists unchanged.
$storage_definition->getSettings() === [
'fruit' => 'banana',
'season' => 'summer',
];
For clarity, it is preferred to use setSetting() if not all available settings are supplied.
Parameters
array$settingsThe array of storage settings.
Returns
$this
}

Implements FieldStorageConfigInterface.

setTranslatable (   $translatable)

{Sets whether the field is translatable.

Parameters
bool$translatableWhether the field is translatable.
Returns
$this
}

Implements FieldStorageConfigInterface.

Field Documentation

const NAME_MAX_LENGTH = 32

The maximum length of the field name, in characters.

For fields created through Field UI, this includes the 'field_' prefix.

Referenced by Comment\baseFieldDefinitions(), and FieldStorageAddForm\buildForm().


The documentation for this class was generated from the following file: