/** * Overload update's method to check some data before update * * @param array $data * @param string $where An SQL WHERE clause. * @return integer The number of rows updated. */ public function update(array $data, $where) { if (isset($data['groups_name'])) { $this->checkGroupName($data['groups_name']); } return parent::update($data, $where); }
/** * Overload insert's method to check some data before insert * * @param array $data * @return integer the last insert ID. */ public function insert(array $data) { if (!isset($data['projects_start_date']) || !$data['projects_start_date']) { $data['projects_start_date'] = date("Y-m-d H:i:s"); } return parent::insert($data); }
/** * Overload update's method to check some data before update * * @param array $data * @param string $where An SQL WHERE clause. * @return integer The number of rows updated. */ public function update(array $data, $where) { return parent::update($this->_cleanData($data), $where); }