function FieldDefinition::createFromFieldStorageDefinition
Creates a new field definition.
Parameters
\Drupal\Core\Field\FieldStorageDefinitionInterface $storageDefinition: The associated field storage definition.
Return value
static
2 calls to FieldDefinition::createFromFieldStorageDefinition()
- EntitySchemaTestHooks::entityBundleFieldInfo in core/
modules/ system/ tests/ modules/ entity_schema_test/ src/ Hook/ EntitySchemaTestHooks.php  - Implements hook_entity_bundle_field_info().
 - FieldDefinitionTest::initializeFieldUsingFactory in core/
tests/ Drupal/ Tests/ Core/ Entity/ FieldDefinitionTest.php  - Creates a bundle field using a specified factory.
 
File
- 
              core/
lib/ Drupal/ Core/ Field/ FieldDefinition.php, line 55  
Class
- FieldDefinition
 - A class for defining entity field definitions.
 
Namespace
Drupal\Core\FieldCode
public static function createFromFieldStorageDefinition(FieldStorageDefinitionInterface $storageDefinition) {
  $field_definition = new static();
  $field_definition->setFieldStorageDefinition($storageDefinition);
  return $field_definition;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.