public function dump()
    {
        if (!method_exists($this->filesystem, 'dumpFile')) {
            throw new \RuntimeException('Method dumpFile() is not available on your Filesystem component version, you should upgrade it.');
        }

        $this->initDirection();
        $feed = $this->feedManager->get($this->name);

        if ($this->entity) {
            $repository = $this->em->getRepository($this->entity);
            $items = $repository->findBy([], $this->orderBy, $this->limit);
            $feed->addFromArray($items);
        } elseif ($feed->hasItems()) {
            throw new \LogicException(sprintf('An entity should be set OR you should use setItems() first'));
        }

        $dump = $feed->render($this->format);
        $filepath = $this->rootDir.$this->filename;

        $this->filesystem->dumpFile($filepath, $dump);
    }
public function dump()
    {
        if (!method_exists($this->filesystem, 'dumpFile')) {
            throw new \RuntimeException('Method dumpFile() is not available on your Filesystem component version, you should upgrade it.');
        }

        $this->initDirection();
        $feed = $this->feedManager->get($this->name);

        if ($this->entity) {
            $repository = $this->em->getRepository($this->entity);
            $items = $repository->findBy([], $this->orderBy, $this->limit);
            $feed->addFromArray($items);
        } elseif ($feed->hasItems()) {
            throw new \LogicException(sprintf('An entity should be set OR you should use setItems() first'));
        }

        $dump = $feed->render($this->format);
        $filepath = $this->rootDir.$this->filename;

        $this->filesystem->dumpFile($filepath, $dump);
    }
public function dump ( ) { if ( ! method_exists ( $ this -> filesystem , 'dumpFile' ) ) { throw new \ RuntimeException ( 'Method dumpFile() is not available on your Filesystem component version, you should upgrade it.' ) ; } $ this -> initDirection ( ) ; $ feed = $ this -> feedManager -> get ( $ this -> name ) ; if ( $ this -> entity ) { $ repository = $ this -> em -> getRepository ( $ this -> entity ) ; $ items = $ repository -> findBy ( [ ] , $ this -> orderBy , $ this -> limit ) ; $ feed -> addFromArray ( $ items ) ; } elseif ( $ feed -> hasItems ( ) ) { throw new \ LogicException ( sprintf ( 'An entity should be set OR you should use setItems() first' ) ) ; } $ dump = $ feed -> render ( $ this -> format ) ; $ filepath = $ this -> rootDir . $ this -> filename ; $ this -> filesystem -> dumpFile ( $ filepath , $ dump ) ; }
Dumps a feed from an entity or feed items using Filesystem component.

@throws \RuntimeException
@throws \LogicException
Dumps a feed from an entity or feed items using Filesystem component .