/** * Called after fields are validated. * @param GROUP $obj * @access private */ protected function _post_validate($obj) { parent::_post_validate($obj); if ($this->num_errors('name') == 0) { $name = $this->value_for('name'); $user_query = $this->app->user_query(); $this->_user = $user_query->object_at_name($name); if (!$this->_user) { $this->record_error('name', 'Please choose a valid user name.'); } if ($this->num_errors('name') == 0) { $user_query = $obj->user_query(); $user = $user_query->object_at_name($name); if ($user) { $this->record_error('name', "[{$name}] is already in this group."); } } } }
/** * Called after fields are validated. * @param SEARCH $obj * @access private */ protected function _post_validate($obj) { parent::_post_validate($obj); if (isset($this->_search)) { $this->_search->fields->validate($this, $obj); } }