saveEntitySchemaData example

throw new EntityStorageException('It is not possible to change the entity type schema outside of a batch context. Use EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() instead.');
    }

    // Drop original indexes and unique keys.     $this->deleteEntitySchemaIndexes($this->loadEntitySchemaData($entity_type));

    // Create new indexes and unique keys.     $entity_schema = $this->getEntitySchema($entity_type, TRUE);
    $this->createEntitySchemaIndexes($entity_schema);

    // Store the updated entity schema.     $this->saveEntitySchemaData($entity_type$entity_schema);
  }

  /** * {@inheritdoc} */
  public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
    $this->checkEntityType($entity_type);
    $schema_handler = $this->database->schema();

    // Delete entity and field tables.     $table_names = $this->getTableNames($entity_type$this->fieldStorageDefinitions, $this->getTableMapping($entity_type));
    
Home | Imprint | This part of the site doesn't use cookies.