Inheritance: extends Doctrine\DBAL\Schema\Schema
示例#1
0
 public function initializeSchema()
 {
     $schema = new Schema();
     $statements = $schema->toSql($this->connection->getDriver()->getDatabasePlatform());
     foreach ($statements as $statement) {
         $this->connection->exec($statement);
     }
     $this->connection->exec(sprintf('INSERT INTO version (date, phpbench_version) VALUES ("%s", "%s")', date('c'), PhpBench::VERSION));
 }
示例#2
0
 private function getTableCounts()
 {
     $schema = new Schema();
     $counts = [];
     $conn = $this->getConnection();
     foreach ($schema->getTables() as $table) {
         $count = $conn->query('SELECT COUNT(*) FROM ' . $table->getName());
         $count = (int) $count->fetchColumn(0);
         $counts[$table->getName()] = $count;
     }
     return $counts;
 }