performFieldSchemaOperation example

$prefix_parts[] = \Drupal::time()->getRequestTime();
    $hash = hash('sha256', implode('', $prefix_parts));

    return $first_prefix_part . substr($hash, 0, 6);
  }

  /** * {@inheritdoc} */
  public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
    $this->fieldStorageDefinitions[$storage_definition->getName()] = $storage_definition;
    $this->performFieldSchemaOperation('create', $storage_definition);
  }

  /** * {@inheritdoc} */
  public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
    $this->fieldStorageDefinitions[$storage_definition->getName()] = $storage_definition;
    $this->performFieldSchemaOperation('update', $storage_definition$original);
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.