本文整理汇总了PHP中error::createUserNotFoundError方法的典型用法代码示例。如果您正苦于以下问题:PHP error::createUserNotFoundError方法的具体用法?PHP error::createUserNotFoundError怎么用?PHP error::createUserNotFoundError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类error
的用法示例。
在下文中一共展示了error::createUserNotFoundError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadByProvider
/**
* Try and load a UserAuthentication account from the gicen provider and provder user id.
* @param $provider the provider
* @param $userproviderid the user provider id
* returns an UserAuthentication instance else return Error;
*/
function loadByProvider($provider, $userproviderid)
{
global $DB, $HUB_SQL;
$params = array();
$params[0] = $provider;
$params[1] = $userproviderid;
$resArray = $DB->select($HUB_SQL->DATAMODEL_USER_AUTH_LOAD_BY_PROVIDER, $params);
if ($resArray !== false) {
$count = count($resArray);
if ($count == 0) {
$ERROR = new error();
$ERROR->createUserNotFoundError($this->authid);
return $ERROR;
} else {
//Should only every be one
$authentication = new UserAuthentication($resArray[0]['AuthID']);
$authentication->load();
return $authentication;
}
} else {
return database_error();
}
}
示例2: getByEmail
/**
* Load user based on their email address
*
* @return User object (this) (or Error object)
*/
function getByEmail()
{
global $DB, $CFG, $ERROR, $HUB_SQL;
$params = array();
$params[0] = $this->email;
$resArray = $DB->select($HUB_SQL->DATAMODEL_USER_BY_EMAIL_SELECT, $params);
if ($resArray !== false) {
$count = count($resArray);
if ($count == 0) {
$ERROR = new error();
$ERROR->createUserNotFoundError($this->userid);
return $ERROR;
} else {
for ($i = 0; $i < $count; $i++) {
$array = $resArray[$i];
$this->userid = trim($array['UserID']);
}
}
} else {
return database_error();
}
return $this->load();
}
示例3: reportpendingmember
/**
* Mark that this user was removed from the group by marking thier requested record as reported
* Only group admins can run this function.
*
* @param string $userid of the user to mark as reported
* @return Group object (this)
*/
function reportpendingmember($userid)
{
global $DB, $CFG, $USER, $HUB_SQL, $LNG;
//check user can edit the group
if (!$this->isgroupadmin($USER->userid)) {
return access_denied_error();
}
// check user exists
$user = new User($userid);
if ($user->load() instanceof Error) {
global $ERROR;
$ERROR = new error();
return $ERROR->createUserNotFoundError($userid);
}
// now add the user
$params = array();
$params[0] = $USER->userid;
$params[1] = time();
$params[2] = $this->groupid;
$params[3] = $userid;
$res = $DB->insert($HUB_SQL->DATAMODEL_GROUP_JOIN_REPORT, $params);
if (!$res) {
return database_error();
}
return $this;
}