You are here

public function Bynder::createMetadataFieldStorage in Bynder 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/media/Source/Bynder.php \Drupal\bynder\Plugin\media\Source\Bynder::createMetadataFieldStorage()
  2. 8.2 src/Plugin/media/Source/Bynder.php \Drupal\bynder\Plugin\media\Source\Bynder::createMetadataFieldStorage()

Creates the metadata field storage definition.

Return value

\Drupal\field\FieldStorageConfigInterface The unsaved field storage definition.

File

src/Plugin/media/Source/Bynder.php, line 445

Class

Bynder
Provides media source plugin for Bynder.

Namespace

Drupal\bynder\Plugin\media\Source

Code

public function createMetadataFieldStorage() {
  return $this->entityTypeManager
    ->getStorage('field_storage_config')
    ->create([
    'entity_type' => 'media',
    'field_name' => BynderMetadataItem::METADATA_FIELD_NAME,
    'type' => 'bynder_metadata',
    'cardinality' => 1,
    'locked' => TRUE,
  ]);
}