-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdoctrine
More file actions
27 lines (20 loc) · 848 Bytes
/
doctrine
File metadata and controls
27 lines (20 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env php
<?php
declare(strict_types=1);
use Core\App\Event\TablePrefixEventListener;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Events;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider;
use Dot\DataFixtures\Command\ExecuteFixturesCommand;
use Dot\DataFixtures\Command\ListFixturesCommand;
require_once 'vendor/autoload.php';
$container = require 'config/container.php';
$entityManager = $container->get(EntityManager::class);
$entityManager->getEventManager()
->addEventListener(Events::loadClassMetadata, $container->get(TablePrefixEventListener::class));
$commands = [
$container->get(ExecuteFixturesCommand::class),
$container->get(ListFixturesCommand::class),
];
ConsoleRunner::run(new SingleManagerProvider($entityManager), $commands);