static function getFirstRacine($_userOwnerID) { $containerID = self::getRacinesContainersId($_userOwnerID); $containerID = $containerID[0][0]; return Db::query("SELECT * FROM Objects WHERE ObjectContainer=? LIMIT 1", $containerID); }
static function getContactsByUser($_userId) { return Db::query("SELECT *\n FROM Contacts\n WHERE ContactUser = ?", $_userId); }
static function deleteUser($_userId) { $infoId = Db::queryFirst("SELECT UserInfo\n FROM Users\n WHERE UserId = ?", $_userId); if (self::isUserFamilyOwner($_userId)) { $childs = Db::query("SELECT UserID\n FROM users INNER JOIN userinfos ON UserInfo = userinfos.UserInfoId\n WHERE UserInfoFamilyOwner = ?", $_userId); foreach ($childs as $child) { Db::execute("DELETE FROM Users\n WHERE UserId = ?", $child[0]); } Db::execute("UPDATE userinfos\n SET UserInfoFamilyOwner = 1\n WHERE UserInfoId = ?", $infoId[0]); } Db::execute("DELETE FROM Users\n WHERE UserId = ?", $_userId); Db::execute("DELETE FROM UserInfos\n WHERE UserInfoId = ?", $infoId[0]); }