|
@@ 349-362 (lines=14) @@
|
| 346 |
|
} |
| 347 |
|
return $this; |
| 348 |
|
} |
| 349 |
|
private function dropTables() |
| 350 |
|
{ |
| 351 |
|
$this->resetNatTimer(); |
| 352 |
|
$em = $this->getEntityManager(); |
| 353 |
|
$metadatas = $em->getMetadataFactory()->getAllMetadata(); |
| 354 |
|
$schemaTool = new SchemaTool($em); |
| 355 |
|
$schemaTool->dropSchema($metadatas); |
| 356 |
|
$em->getConnection()->executeQuery('DROP TABLE IF EXISTS doctrine_migration_versions'); |
| 357 |
|
return $this; |
| 358 |
|
} |
| 359 |
|
/** |
| 360 |
|
* @return EntityManager |
| 361 |
|
*/ |
| 362 |
|
private function getEntityManager() |
| 363 |
|
{ |
| 364 |
|
if (!isset($this->app['orm.em'])) { |
| 365 |
|
$config_file = $this->config_path . '/database.php'; |
|
@@ 415-426 (lines=12) @@
|
| 412 |
|
} |
| 413 |
|
return $em = $this->app['orm.em']; |
| 414 |
|
} |
| 415 |
|
private function createTables() |
| 416 |
|
{ |
| 417 |
|
$this->resetNatTimer(); |
| 418 |
|
$em = $this->getEntityManager(); |
| 419 |
|
$metadatas = $em->getMetadataFactory()->getAllMetadata(); |
| 420 |
|
$schemaTool = new SchemaTool($em); |
| 421 |
|
$schemaTool->createSchema($metadatas); |
| 422 |
|
return $this; |
| 423 |
|
} |
| 424 |
|
private function importCsv() { |
| 425 |
|
$em = $this->getEntityManager(); |
| 426 |
|
$loader = new \Eccube\Doctrine\Common\CsvDataFixtures\Loader(); |
| 427 |
|
$loader->loadFromDirectory(__DIR__.'/../../Resource/doctrine/import_csv'); |
| 428 |
|
$Executor = new \Eccube\Doctrine\Common\CsvDataFixtures\Executor\DbalExecutor($em); |
| 429 |
|
$fixtures = $loader->getFixtures(); |