Sonata\Exporter\Handler::export PHP Method

export() public method

public export ( )
    public function export()
    {
        $this->writer->open();
        foreach ($this->source as $data) {
            $this->writer->write($data);
        }
        $this->writer->close();
    }

Usage Example

Example #1
0
 public function testHandler()
 {
     $source = $this->getMock('Sonata\\Exporter\\Source\\SourceIteratorInterface');
     $writer = $this->getMock('Sonata\\Exporter\\Writer\\WriterInterface');
     $writer->expects($this->once())->method('open');
     $writer->expects($this->once())->method('close');
     $exporter = new Handler($source, $writer);
     $exporter->export();
 }