public function execute(&$value, &$error) { $user_id = sfContext::getInstance()->getUser()->getId(); $user_private_data = UserPrivateData::find($user_id); if (!myUser::check_password($value, $user_private_data->password)) { $error = $this->getParameterHolder()->get('bad_password_error'); return false; } return true; }