Пример #1
0
 static function deleteLoan($_loanId)
 {
     $loan = self::getLoan($_loanId);
     $objectId = $loan["LoanObject"];
     if (Db::execute("DELETE FROM Loans\n            WHERE LoanId = ?", $_loanId)) {
         return Db::execute("UPDATE Objects\n                                SET ObjectIsLent = 0\n                                WHERE ObjectID = ?", $objectId);
     } else {
         return false;
     }
 }
Пример #2
0
 static function getFirstRacine($_userOwnerID)
 {
     $containerID = self::getRacinesContainersId($_userOwnerID);
     $containerID = $containerID[0][0];
     return Db::query("SELECT * FROM Objects WHERE ObjectContainer=? LIMIT 1", $containerID);
 }
Пример #3
0
 static function getUserIdByMobileToken($_token)
 {
     $result = Db::queryFirst("SELECT UserId\n                FROM Users\n                WHERE UserMobileToken = ?", $_token);
     if (!$result) {
         return -1;
     }
     return $result["UserId"];
 }