/** * * @param string|array $path * @param array $options * @return FixtureCollection */ public function load($path, array $options = array()) { $collection = new FixtureCollection(); foreach ($this->loaders as $loader) { $data = $loader->load($path, $options); $collection->merge($data); } return $collection; }
/** * * @param mixed $path * @param array $options * @return FixtureCollection */ public function load($path, array $options = array()) { if (!is_array($path)) { return $this->loader->load($path, $options); } $collection = new FixtureCollection(); foreach ($path as $p) { $c = $this->loader->load($p, $options); $collection->merge($c); } return $collection; }
/** * * @param string|array $path * @param array $options * @return FixtureCollection */ public function load($path, array $options = array()) { if (empty($path)) { $path = $this->getFixturesByBundles(); } elseif (!is_array($path)) { $path = array($path); } $collection = new FixtureCollection(); foreach ($path as $p) { $collection->merge($this->loader->load($p)); } return $collection; }
/** * * @param string|array $path * @param array $options * @return FixtureCollection */ public function load($path, array $options = array()) { if (!file_exists($path)) { throw new \RuntimeException(sprintf('"%s" dir or file not found', $path)); } if (is_file($path)) { return $this->loader->load($path, $options); } $finder = new Finder(); $finder->in($path)->files(); $collection = new FixtureCollection(); foreach ($finder as $file) { $col = $this->loader->load(realpath($file->getPathname()), $options); $collection->merge($col); } return $collection; }