/** * Preprocess the model to add specific options */ protected function preprocessModel() { parent::preprocessModel(); $labeledCols = $this->getLabeledColumns(); foreach ($labeledCols as $columnName) { $options = array(); $type = $this->model->get($columnName, 'type'); switch ($type) { case \MUtil_Model::TYPE_DATE: $options['dateFormat'] = 'yyyy-MM-dd'; break; case \MUtil_Model::TYPE_DATETIME: $options['dateFormat'] = 'dd-MM-yyyy HH:mm:ss'; break; case \MUtil_Model::TYPE_TIME: $options['dateFormat'] = 'HH:mm:ss'; break; case \MUtil_Model::TYPE_NUMERIC: break; //When no type set... assume string //When no type set... assume string case \MUtil_Model::TYPE_STRING: default: $type = \MUtil_Model::TYPE_STRING; $options['formatFunction'] = 'formatString'; break; } $options['type'] = $type; $this->model->set($columnName, $options); } }