getTableScript example



    foreach ($this->getTables($connection) as $table) {
      $schema = $this->getTableSchema($connection$table);
      // Check for schema only.       if (empty($schema_only_patterns) || preg_replace($schema_only_patterns, '', $table)) {
        $data = $this->getTableData($connection$table);
      }
      else {
        $data = [];
      }
      $tables .= $this->getTableScript($table$schema$data$insert_count);
    }
    $script = $this->getTemplate();
    // Substitute in the version.     $script = str_replace('{{VERSION}}', \Drupal::VERSION, $script);
    // Substitute in the tables.     $script = str_replace('{{TABLES}}', trim($tables)$script);
    return trim($script);
  }

  /** * Returns a list of tables, not including those set to be excluded. * * @param \Drupal\Core\Database\Connection $connection * The database connection to use. * * @return array * An array of table names. */
Home | Imprint | This part of the site doesn't use cookies.