/** * Получает на вход массив * * @param Array $location Ключи: "countryId", "regionId", "cityId" * @return UserLocation */ public function __construct($location, &$user) { parent::__construct(); if (isset($location["countryId"]) && isset($location["regionId"]) && isset($location["cityId"])) { $this->_userId = $user->id; $this->_user = $user; $this->location = $location; } }
/** * Конструктор. Получает данные текущего пользователя, создаёт объект для доступа к бд * */ public function __construct($id = NULL) { parent::__construct(); if ($id == NULL) { $user = new User(); $this->_curentId = $user->id; } else { $this->_curentId = $id; } }
/** * Консртуктор. Выполняется подключение базового класса YT. */ function __construct() { $rootdir = $_SERVER["DOCUMENT_ROOT"]; substr($rootdir, -1) == "/" ? $rootdir : ($rootdir = $rootdir . "/"); $clientLibraryPath = 'engine/libs/video'; $oldPath = set_include_path($rootdir . $clientLibraryPath); Zend_Loader::loadClass('Zend_Gdata_YouTube'); parent::__construct(); $string = "CREATE TABLE IF NOT EXISTS `Videos` (\n\t\t\t `id` int(11) NOT NULL,\n\t\t\t `videoID` varchar(255) DEFAULT NULL,\n\t\t\t `title` varchar(255) DEFAULT NULL,\n\t\t\t `comment` varchar(500) DEFAULT NULL,\n\t\t\t `user` int(11) NOT NULL,\n\t\t\t `sqrty` int(11) DEFAULT NULL,\n\t\t\t `sq_list` varchar(1000) NOT NULL,\n\t\t\t PRIMARY KEY (`id`)\n\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=cp1251 ;"; $this->_sql->query($string); }
public function __construct($id = NULL) { parent::__construct(); secureStartSession(); if ($id == NULL || $id == $_SESSION["user"]["id"]) { $this->setData($_SESSION["user"]); $this->isOnline = true; $this->checkLastTime(self::$updateInterval); } else { try { $this->setData($this->getDataFromDb($id)); } catch (Exception $ex) { throw new UserException($id, UserException::USR_NOT_EXSIST); } } }
/** * Получает группу по ID и её заголовок * * @param mixed $groupId * @param mixed $title * @return Group */ public function __construct($groupId, $title) { parent::__construct(); $this->id = $groupId; $this->title = $title; }
/** * Конструктор * */ public function __construct() { secureStartSession(); parent::__construct(); }
public function __construct(User &$user) { parent::__construct(); $this->_userId = $user->id; $this->_perm = new AccessLevelRights($this->getPermissions()); }
/** * Конструктор * * @param integer $id Необязательный параметр. Если NULL, то берутся данные * пользователя который вошёл в систему (сессии), иначе по ID другого пользователя * @return User */ public final function __construct($id = NULL) { if (self::$instance != true) { throw new UserException(UserException::CREATION, 0); } MySQLConnector::__construct(); secureStartSession(); if ($id == NULL || $id == $_SESSION["user"]["id"]) { if (!isset($_SESSION["user"])) { $userSignOut = new UserSignInOut(); if ($userSignOut->checkIfSave()) { $uId = (int) $_COOKIE["id"]; $this->_sql->query("SELECT `mail`,`password` FROM `SITE_USERS` WHERE `id`={$uId}"); $secArr = $this->_sql->GetRows(); $mailSec = $secArr[0]["mail"]; $pass = $secArr[0]["password"]; if (md5($uId) . md5($mailSec) != $_COOKIE["sec"]) { throw new UserException("", UserException::USR_NOT_AUTENT); } else { $userSignOut->authentication($mailSec, $pass, false, true); $this->setData($_SESSION["user"]); $this->isOnline = true; } } else { throw new UserException("", UserException::USR_NOT_AUTENT); } } else { $this->setData($_SESSION["user"]); $this->isOnline = true; $this->checkLastTime(parent::$updateInterval); } } else { try { $this->other = true; $this->setData($this->getDataFromDb($id)); } catch (Exception $ex) { throw new UserException($id, UserException::USR_NOT_EXSIST); } } }
/** * Конструктор. Получает текущее время * * @param integer $time Текущее время в секундах * @return Finder */ public function __construct($time) { parent::__construct(); $this->_time = $time; }
/** * Конструктор * */ public function __construct() { parent::__construct(); $user = UserFull::create(); $this->_curentId = $user->id; }
public function __construct() { parent::__construct(); $this->_user = new UserFull(); $this->_id = $this->_user->id; }
public function __construct($id = NULL) { parent::__construct(); $this->_id = (int) $id; }
public function __construct($id) { parent::__construct(); $this->_userId = $id; }