Beispiel #1
0
 public static function getIdByUserId($userId)
 {
     $res = FuserTable::getList(array('filter' => array('USER_ID' => $userId), 'select' => array('ID')));
     if ($fuserData = $res->fetch()) {
         return intval($fuserData['ID']);
     } else {
         /** @var Result $r */
         $r = static::createForUserId($userId);
         if ($r->isSuccess()) {
             return $r->getId();
         }
     }
     return false;
 }
Beispiel #2
0
 /**
  * Return user by fuserId.
  *
  * @param int $fuserId		Fuser Id.
  * @return int
  * @throws Main\ArgumentException
  */
 public static function getUserIdById($fuserId)
 {
     $result = 0;
     $fuserId = (int) $fuserId;
     if ($fuserId <= 0) {
         return $result;
     }
     $row = FuserTable::getList(array('select' => array('USER_ID'), 'filter' => array('=ID' => $fuserId), 'order' => array('ID' => "DESC")))->fetch();
     if (!empty($row)) {
         $result = (int) $row['USER_ID'];
     }
     return $result;
 }