/** * Sets the format of the column. * * @access public * @param integer $index * @param \Khill\Lavacharts\DataTables\Formats\Format $format * @return \Khill\Lavacharts\DataTables\DataTable * @throws \Khill\Lavacharts\Exceptions\InvalidColumnIndex */ public function formatColumn($index, Format $format) { $this->indexCheck($index); $this->cols[$index] = ColumnFactory::applyFormat($this->cols[$index], $format); return $this; }
/** * Creates a new Column with the same values, while applying the Format. * * @param \Khill\Lavacharts\DataTables\Columns\Column $column * @param \Khill\Lavacharts\DataTables\Formats\Format $format * @return \Khill\Lavacharts\DataTables\Columns\Column */ public static function applyFormat(Column $column, Format $format) { return ColumnFactory::create($column->getType(), $column->getLabel(), $format, $column->getRole()); }