Пример #1
0
 static function addException($_objectId, $_userId)
 {
     return Db::createLastID("INSERT INTO RightExceptions\n                (RightExceptionUser, RightExceptionObject)\n                VALUES (?, ?)", array($_userId, $_objectId));
 }
Пример #2
0
 static function addFamilyOwner($_email, $_phone, $_firstName, $_lastName, $_hash, $_salt)
 {
     //Le contrôleur est en charge de vérifié si le nom d'utilisateur est déjà existant
     $userId = Db::createLastID("INSERT INTO Users (UserName,UserHash,UserSalt)\n                                    VALUES (?,?,?)", array($_email, $_hash, $_salt));
     $infoId = Db::createLastID("INSERT INTO UserInfos (UserInfoFirstName,UserInfoLastName,UserInfoTel,UserInfoFamilyOwner,UserInfoIsMod,UserInfoStatus)\n                                    VALUES (?,?,?,?,1,0) ", array($_firstName, $_lastName, $_phone, $userId));
     Db::execute("UPDATE Users\n                                    SET UserInfo = ?\n                                    WHERE UserId = ?", array($infoId, $userId));
     return $userId;
 }