/**
  * Creates a loader
  *
  * @param ObjectManager       $objectManager
  * @param ReferenceRepository $referenceRepository
  * @param string              $name
  * @param string              $extension
  *
  * @return LoaderInterface
  */
 public function create(ObjectManager $objectManager, ReferenceRepository $referenceRepository, $name, $extension)
 {
     $this->doctrineCache->setReferenceRepository($referenceRepository);
     $reader = $this->configRegistry->getReader($name, $extension);
     $processor = $this->configRegistry->getProcessor($name, $extension);
     $class = $this->configRegistry->getClass($name);
     $multiple = $this->configRegistry->isMultiple($name);
     return $this->createLoader($objectManager, $reader, $processor, $class, $multiple);
 }
 /**
  * Loads multiple fixture files
  *
  * @param ObjectManager       $objectManager
  * @param ReferenceRepository $referenceRepository
  * @param array               $paths
  *
  * @throws FixtureLoaderException
  */
 public function load(ObjectManager $objectManager, ReferenceRepository $referenceRepository, array $paths)
 {
     foreach ($this->registry->getFixtures($paths) as $fixtureConfig) {
         $loader = $this->factory->create($objectManager, $referenceRepository, $fixtureConfig['name'], $fixtureConfig['extension']);
         try {
             $loader->load($fixtureConfig['path']);
         } catch (InvalidItemException $ex) {
             throw new FixtureLoaderException($fixtureConfig, $ex);
         }
     }
 }