public static function getByID($id) { if ($docs = TlonData::select(self::$TABLE, 'id', $id)) { return $docs[0]; } else { return false; } }
public static function getByGroupname($groupname) { if ($gs = TlonData::select(self::$TABLE, 'groupname', $groupname)) { return $gs[0]; } else { return false; } }
/** * check(): Check if nonce exists (having deleted stale ones); if it is, delete it and return true. * @param string $nonce Nonce to check. * @return bool */ public static function check($nonce) { self::clean(); if (TlonData::select(self::$TABLE, 'nonce', $nonce)) { TlonData::delete(self::$TABLE, TlonDataComparison::equals('nonce', $nonce)); return true; } else { return false; } }
public static function getByDocumentID($did) { return TlonData::select(self::$TABLE, 'document_id', $did); }
public static function getByUsername($username) { return TlonData::select(self::$TABLE, 'username', $username); }
public static function getByArrivalTimeBefore($time) { return TlonData::select(self::$TABLE, 'arrival_time', $time, '<'); }
public static function getByGroupname($groupname) { return TlonData::select(self::$TABLE, 'groupname', $groupname); }
/** * getByUsername(): Get user with given username. * @param string $username Username. * @return array Hash representing user. */ public static function getByUsername($username) { $users = TlonData::select(self::$TABLE, 'username', $username); if ($users) { return $users[0]; } else { return false; } }