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
ファイル: RepositoryTest.php プロジェクト: dantleech/phpbench
 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;
 }