|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Hautelook\AliceBundle package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Baldur Rensch <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Hautelook\AliceBundle\Doctrine\Command; |
|
13
|
|
|
|
|
14
|
|
|
use Doctrine\Common\Persistence\ManagerRegistry; |
|
15
|
|
|
use Hautelook\AliceBundle\Alice\DataFixtures\Fixtures\LoaderInterface as FixturesLoaderInterface; |
|
16
|
|
|
use Hautelook\AliceBundle\Alice\DataFixtures\LoaderInterface; |
|
17
|
|
|
use Hautelook\AliceBundle\Doctrine\DataFixtures\Executor\FixturesExecutorInterface; |
|
18
|
|
|
use Hautelook\AliceBundle\Doctrine\Generator\LoaderGeneratorInterface; |
|
19
|
|
|
use Hautelook\AliceBundle\Finder\FixturesFinderInterface; |
|
20
|
|
|
use Hautelook\AliceBundle\Resolver\BundlesResolverInterface; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Factory class to generate Doctrine load data fixtures commands. |
|
24
|
|
|
* |
|
25
|
|
|
* @author Théo FIDRY <[email protected]> |
|
26
|
|
|
*/ |
|
27
|
|
|
class CommandFactory |
|
28
|
|
|
{ |
|
29
|
|
|
/** |
|
30
|
|
|
* @param string $name Command name |
|
31
|
|
|
* @param ManagerRegistry $doctrine |
|
32
|
|
|
* @param LoaderInterface $loader |
|
33
|
|
|
* @param FixturesLoaderInterface $fixturesLoader |
|
34
|
|
|
* @param FixturesFinderInterface $fixturesFinder |
|
35
|
|
|
* @param BundlesResolverInterface $bundlesResolver |
|
36
|
|
|
* @param LoaderGeneratorInterface $loaderGenerator |
|
37
|
|
|
* @param FixturesExecutorInterface $fixturesExecutor |
|
38
|
|
|
* |
|
39
|
|
|
* @return LoadDataFixturesCommand |
|
40
|
|
|
*/ |
|
41
|
12 |
|
public function createCommand( |
|
42
|
|
|
$name, |
|
43
|
|
|
ManagerRegistry $doctrine, |
|
44
|
|
|
LoaderInterface $loader, |
|
45
|
|
|
FixturesLoaderInterface $fixturesLoader, |
|
46
|
|
|
FixturesFinderInterface $fixturesFinder, |
|
47
|
|
|
BundlesResolverInterface $bundlesResolver, |
|
48
|
|
|
LoaderGeneratorInterface $loaderGenerator, |
|
49
|
|
|
FixturesExecutorInterface $fixturesExecutor |
|
50
|
|
|
) { |
|
51
|
12 |
|
return new LoadDataFixturesCommand( |
|
52
|
12 |
|
$name, |
|
53
|
12 |
|
$doctrine, |
|
54
|
12 |
|
$loader, |
|
55
|
12 |
|
$fixturesLoader, |
|
56
|
12 |
|
$fixturesFinder, |
|
57
|
12 |
|
$bundlesResolver, |
|
58
|
12 |
|
$loaderGenerator, |
|
59
|
|
|
$fixturesExecutor |
|
60
|
12 |
|
); |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|