protected function BlazyCreationTestTrait::getBlazyFieldDefinition in Blazy 8.2
Same name and namespace in other branches
- 8 tests/src/Traits/BlazyCreationTestTrait.php \Drupal\Tests\blazy\Traits\BlazyCreationTestTrait::getBlazyFieldDefinition()
Gets the field definition.
Parameters
string $field_name: Formatted field name.
Return value
\Drupal\Core\Field\FieldDefinitionInterface The field definition.
See also
BaseFieldDefinition::createFromFieldStorageDefinition()
1 call to BlazyCreationTestTrait::getBlazyFieldDefinition()
- BlazyCreationTestTrait::getFormatterInstance in tests/
src/ Traits/ BlazyCreationTestTrait.php - Returns the field formatter instance.
File
- tests/
src/ Traits/ BlazyCreationTestTrait.php, line 83
Class
- BlazyCreationTestTrait
- A Trait common for Blazy tests.
Namespace
Drupal\Tests\blazy\TraitsCode
protected function getBlazyFieldDefinition($field_name = '') {
$field_name = empty($field_name) ? $this->testFieldName : $field_name;
$field_storage_config = $this
->getBlazyFieldStorageDefinition($field_name);
return $field_storage_config ? BaseFieldDefinition::createFromFieldStorageDefinition($field_storage_config) : FALSE;
}