当前位置: 首页>>代码示例>>PHP>>正文


PHP error::createUserNotFoundError方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:uniteddiversity,项目名称:DebateHub,代码行数:29,代码来源:userauthentication.class.php

示例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();
 }
开发者ID:uniteddiversity,项目名称:LiteMap,代码行数:28,代码来源:user.class.php

示例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;
 }
开发者ID:uniteddiversity,项目名称:DebateHub,代码行数:33,代码来源:group.class.php


注:本文中的error::createUserNotFoundError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。