Ejemplo n.º 1
0
 public function getColumns()
 {
     $columns = array();
     foreach ($this->outputColumnNames as $col) {
         $column = new Column();
         $column->setName(trim($col['name']));
         $column->setLength(trim($col['typelength']));
         $column->setType(strtoupper(trim($col['type'])));
         $column->setPrecision('');
         $columns[] = $column;
     }
     return $columns;
 }
Ejemplo n.º 2
0
 /**
  * @param string  $filename
  * @param array   $columns
  * @param string  $seperator
  * @param string  $enclosure
  * @param string  $escape
  * @param integer $skiprows
  */
 public function __construct($filename, $columns, $seperator = ',', $enclosure = '"', $escape = '\\', $skiprows = 0)
 {
     $this->filename = $filename;
     $this->columns = Column::unserializeArray($columns);
     $this->seperator = $seperator;
     $this->enclosure = $enclosure;
     $this->escape = $escape;
     $this->skiprows = (int) $skiprows;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getColumns()
 {
     $columns = array();
     $i = 0;
     while ($i < $this->stmt->columnCount()) {
         $meta = $this->stmt->getColumnMeta($i++);
         $columns[] = Column::createNew()->setName((string) $meta['name'])->setLength((string) $meta['len'])->setType((string) $meta['native_type'])->setPrecision((string) $meta['precision']);
     }
     return Column::reassignAliases($columns);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function getColumns()
 {
     return Column::reassignAliases(array(Column::createNew()->setType('integer')->setName('date')->setLength(8)));
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function getColumns()
 {
     return Column::reassignAliases(array($this->outputColumn));
 }
Ejemplo n.º 6
0
 /**
  * @dataProvider testUnserializeWithInvalidInputDataProvider
  * @expectedException InvalidArgumentException
  */
 public function testUnserializeWithInvalidInput($invalidSerializedColumn)
 {
     Column::unserialize($invalidSerializedColumn);
 }
Ejemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function getColumns()
 {
     return Column::reassignAliases(array(Column::createNew()->setName('year')->setType('integer')->setLength(4), Column::createNew()->setName('month')->setType('integer')->setLength(2), Column::createNew()->setName('weeknumber')->setType('integer')->setLength(3), Column::createNew()->setName('yearmonth')->setType('integer')->setLength(6), Column::createNew()->setName('quarter')->setType('integer')->setLength(1), Column::createNew()->setName('yearquarter')->setType('integer')->setLength(5), Column::createNew()->setName('yearquartermonth')->setType('integer')->setLength(7), Column::createNew()->setName('weekday')->setType('integer')->setLength(1), Column::createNew()->setName('weekdayname')->setType('string')->setLength(16), Column::createNew()->setName('weekdayflag')->setType('string')->setLength(1)));
 }