| 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 | 120 |  |     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 | 120 |  |         return new LoadDataFixturesCommand( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 | 120 |  |             $name, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 | 120 |  |             $doctrine, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 | 120 |  |             $loader, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 | 120 |  |             $fixturesLoader, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 | 120 |  |             $fixturesFinder, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 | 120 |  |             $bundlesResolver, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 | 120 |  |             $loaderGenerator, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |             $fixturesExecutor | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 | 120 |  |         ); | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 61 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 62 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 63 |  |  |  |