public function setColumnFunction($function, $arguments = null, $columns, $overwrite = true)
{
// call the parent
parent::setColumnFunction($function, $arguments, $columns, $overwrite);
// redefine columns
$columns = (array) $columns;
$attributes = null;
// based on the function we should prepopulate the attributes array
switch ($function) {
// timeAgo
case array('DataGridFunctions', 'getTimeAgo'):
$attributes = array('class' => 'date');
$headerAttributes = array('class' => 'date');
break;
}
// add attributes if they are given
if (!empty($attributes)) {
// loop and set attributes
foreach ($columns as $column) {
$this->setColumnAttributes($column, $attributes);
}
}
// add attributes if they are given
if (!empty($headerAttributes)) {
// loop and set attributes
foreach ($columns as $column) {
$this->setColumnHeaderAttributes($column, $attributes);
}
}
}