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; }
/** * @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; }
/** * {@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); }
/** * {@inheritdoc} */ public function getColumns() { return Column::reassignAliases(array(Column::createNew()->setType('integer')->setName('date')->setLength(8))); }
/** * {@inheritdoc} */ public function getColumns() { return Column::reassignAliases(array($this->outputColumn)); }
/** * @dataProvider testUnserializeWithInvalidInputDataProvider * @expectedException InvalidArgumentException */ public function testUnserializeWithInvalidInput($invalidSerializedColumn) { Column::unserialize($invalidSerializedColumn); }
/** * {@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))); }