[DoctrineBundle] use namespace and fix double variable declaration
This commit is contained in:
parent
5d87d83a10
commit
56dc1281d0
@ -18,8 +18,11 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
use Symfony\Component\Console\Output\Output;
|
use Symfony\Component\Console\Output\Output;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
|
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
|
||||||
|
use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader as DataFixturesLoader;
|
||||||
use Doctrine\Common\Cli\Configuration;
|
use Doctrine\Common\Cli\Configuration;
|
||||||
use Doctrine\Common\Cli\CliController as DoctrineCliController;
|
use Doctrine\Common\Cli\CliController as DoctrineCliController;
|
||||||
|
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
|
||||||
|
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Doctrine\ORM\Internal\CommitOrderCalculator;
|
use Doctrine\ORM\Internal\CommitOrderCalculator;
|
||||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||||
@ -72,15 +75,15 @@ EOT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$loader = $loader = new \Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader($this->container);
|
$loader = new DataFixturesLoader($this->container);
|
||||||
foreach ($paths as $path) {
|
foreach ($paths as $path) {
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
$loader->loadFromDirectory($path);
|
$loader->loadFromDirectory($path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fixtures = $loader->getFixtures();
|
$fixtures = $loader->getFixtures();
|
||||||
$purger = new \Doctrine\Common\DataFixtures\Purger\ORMPurger($em);
|
$purger = new ORMPurger($em);
|
||||||
$executor = new \Doctrine\Common\DataFixtures\Executor\ORMExecutor($em, $purger);
|
$executor = new ORMExecutor($em, $purger);
|
||||||
$executor->setLogger(function($message) use ($output) {
|
$executor->setLogger(function($message) use ($output) {
|
||||||
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message));
|
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message));
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user