/** * Supplemental function to create columns from strings. * * @access protected * @param string $type Type of column to create * @param string $label Label for the column. (Optional) * @param \Khill\Lavacharts\DataTables\Formats\Format $format A column format object. (Optional) * @param string $role A role for the column. (Optional) * @return \Khill\Lavacharts\DataTables\DataTable */ protected function createColumnWithParams($type, $label = '', $format = null, $role = '') { $this->cols[] = ColumnFactory::create($type, $label, $format, $role); 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()); }