Ejemplo n.º 1
0
 /**
  * Parse the rows looking for the header row and storing it locally
  *
  * @param array $current
  * @param int   $key
  *
  * @return bool
  */
 public function handleHeaderRow(array $current, $key)
 {
     if ($key == $this->csvFormat->getHeaderRow() - 1) {
         if (count($current) > 1 || strlen($current[0]) > 0) {
             $this->headerRow = $current;
         }
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Return an initial block if required
  *
  * @return string
  */
 public function getInitialBlock()
 {
     $linePad = $this->csvFormat->hasHeaderRow() ? $this->csvFormat->getHeaderRow() - 1 : $this->csvFormat->getDataStart() - 1;
     return $this->initial . str_repeat($this->getRowSeparator(), $linePad);
 }