Model\Invite::getInvitesByUid PHP Method

getInvitesByUid() public static method

Get invites by uid
public static getInvitesByUid ( integer $uid, string $status = "" ) : array
$uid integer
$status string
return array
    public static function getInvitesByUid($uid = -1, $status = "")
    {
        $sql = "SELECT * FROM invite WHERE uid={$uid} ";
        if ($status != "") {
            $sql .= "AND status={$status} ";
        }
        $sql .= "ORDER BY dateLine DESC";
        $stn = DB::sql($sql);
        $stn->execute();
        return $stn->fetchAll(DB::FETCH_CLASS, __CLASS__);
    }

Usage Example

Example #1
0
 /**
  *    Invite list
  *    2015.11.11 start
  */
 public function invite()
 {
     $data['user'] = User::getUserByUserId(User::getCurrent()->uid);
     $data['inviteList'] = Invite::getInvitesByUid($data['user']->uid, "0");
     Template::setContext($data);
     Template::setView("panel/invite");
 }