You are here

protected function StorageManager::createFieldStorage in Paragraph View Mode 2.x

Same name and namespace in other branches
  1. 8 src/StorageManager.php \Drupal\paragraph_view_mode\StorageManager::createFieldStorage()

Create field storage configuration entity.

Return value

\Drupal\Core\Entity\EntityInterface Field storage configuration entity.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to StorageManager::createFieldStorage()
StorageManager::getFieldStorage in src/StorageManager.php
Get field config storage.

File

src/StorageManager.php, line 246

Class

StorageManager
Provides fields and forms storage operations required by the module.

Namespace

Drupal\paragraph_view_mode

Code

protected function createFieldStorage() : EntityInterface {
  $field_storage = FieldStorageConfig::create([
    'entity_type' => StorageManagerInterface::ENTITY_TYPE,
    'field_name' => StorageManagerInterface::FIELD_NAME,
    'type' => StorageManagerInterface::FIELD_TYPE,
    'locked' => TRUE,
  ]);
  $field_storage
    ->save();
  return $field_storage;
}