Ricardo Stuven’s comment inspired me to completely refactor a function described in an earlier post. So from now on my app model contains two functions: setBoolean and setDate. First, Ricardo’s setBoolean function: function setBoolean($field) { $this->data[$this->name][$field] = isset($this->data[$this->name][$field]) ? 1 : 0; } Second, my setDate function: function setDate($field, $format = 'Y-m-