/** * Called after fields are validated. * Check whether the object has changed since this form was loaded. If it has, do not update * the object with this form's contents (else it will overwrite newly-stored changes). * @param object $obj Object being validated. * @access private */ protected function _post_validate($obj) { if ($obj->exists()) { $time_modified = $this->value_for('time_modified'); if (!$obj->time_modified->equals($time_modified)) { $type_info = $obj->type_info(); $msg = '<p>This ' . strtolower($type_info->singular_title) . ' has been changed by another user; you cannot save your changes. ' . 'Please cancel this form or reload the page and try applying the changes again.</p>'; $this->allow_cancel_only = true; $this->record_error(Form_general_error_id, $msg); } } parent::_post_validate($obj); }
protected function _post_validate($obj) { parent::_post_validate($obj); $this->_search_fields->validate($this, $obj); }