load->helper('Message'); } /** * * @param type $data * @return typeparses empty string to NULL */ protected function _parseData($data) { if(is_array($data)) { foreach($data as $key=>$value) { if($value === '') { $data[$key] = NULL; } } return $data; } elseif(is_object($data)) { //TODO } else { if($data == '') { return NULL; } } } }