private function EntityUpdateService::doFieldUpdate in Entity Construction Kit (ECK) 8
Performs a field storage definition update.
Parameters
string $op: The operation to perform, possible values are:
- EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED
- EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED
- EntityDefinitionUpdateManagerInterface::DEFINITION_DELETED.
\Drupal\Core\Field\FieldStorageDefinitionInterface|null $storage_definition: (optional) The new field storage definition. Defaults to none.
\Drupal\Core\Field\FieldStorageDefinitionInterface|null $original_storage_definition: (optional) The original field storage definition. Defaults to none.
1 call to EntityUpdateService::doFieldUpdate()
- EntityUpdateService::applyUpdates in src/
EntityUpdateService.php - Applies all the detected valid changes.
File
- src/
EntityUpdateService.php, line 176
Class
- EntityUpdateService
- Class to update entity and field storage for ECK entities.
Namespace
Drupal\eckCode
private function doFieldUpdate($op, FieldStorageDefinitionInterface $storage_definition = NULL, FieldStorageDefinitionInterface $original_storage_definition = NULL) {
switch ($op) {
case EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED:
$this->fieldStorageDefinitionListener
->onFieldStorageDefinitionCreate($storage_definition);
break;
case EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED:
if ($storage_definition && $original_storage_definition) {
$this->fieldStorageDefinitionListener
->onFieldStorageDefinitionUpdate($storage_definition, $original_storage_definition);
}
break;
case EntityDefinitionUpdateManagerInterface::DEFINITION_DELETED:
if ($original_storage_definition) {
$this->fieldStorageDefinitionListener
->onFieldStorageDefinitionDelete($original_storage_definition);
}
break;
}
}