saveFieldSchemaData example

$schema = $this->getDedicatedTableSchema($storage_definition);

    if (!$only_save) {
      foreach ($schema as $name => $table) {
        // Check if the table exists because it might already have been         // created as part of the earlier entity type update event.         if (!$this->database->schema()->tableExists($name)) {
          $this->database->schema()->createTable($name$table);
        }
      }
    }
    $this->saveFieldSchemaData($storage_definition$schema);
  }

  /** * Creates the schema for a field stored in a shared table. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition * The storage definition of the field being created. * @param bool $only_save * (optional) Whether to skip modification of database tables and only save * the schema data for future comparison. For internal use only. This is * used by onEntityTypeCreate() after it has already fully created the * shared tables. */
Home | Imprint | This part of the site doesn't use cookies.