Exemplo n.º 1
0
 /**
  * @param \Madewithlove\Export\Csv\Transformer $transformer
  *
  * @return \League\Csv\Writer
  */
 private function writer(Transformer $transformer = null)
 {
     $writer = Writer::createFromFileObject(new SplTempFileObject());
     if ($transformer instanceof WithHeaders) {
         $writer->insertOne($transformer->getHeaders());
     }
     if ($transformer instanceof Transformer) {
         $writer->addFormatter([$transformer, 'transform']);
     }
     return $writer;
 }
Exemplo n.º 2
0
 /**
  * @param array $row
  *
  * @return array
  */
 public function transform(array $row)
 {
     return $this->wrapped->transform($row);
 }