/** * Build the columns. * * @param TableBuilder $builder * @param $entry * @return ColumnCollection */ public function build(TableBuilder $builder, $entry) { $table = $builder->getTable(); $columns = new ColumnCollection(); $this->input->read($builder); foreach ($builder->getColumns() as $column) { array_set($column, 'entry', $entry); $column = $this->evaluator->evaluate($column, compact('entry', 'table')); $column['value'] = $this->value->make($table, $column, $entry); $columns->push($this->factory->make($column)); } return $columns; }
/** * Add a column * * @param string $fieldName * @param bool $toReplace * @param null|string $dateFormat * @param null|string $defaultValue * * @return $this */ public function addColumn($fieldName, $toReplace = false, $dateFormat = null, $defaultValue = null) { $column = new Column($fieldName, $toReplace, $dateFormat, $defaultValue); $this->columns->addColumn($column); return $this; }