public function __construct(Language $language = null, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); if ($language === null) { $shortName = false; if (isset($_GET['language']) && $this->languageExists($_GET['language'])) { $shortName = $_GET['language']; } elseif (isset($_SESSION['language']) && $this->languageExists($_SESSION['language'])) { $shortName = $_SESSION['language']; } elseif (isset($_COOKIE['language']) && $this->languageExists($_COOKIE['language'])) { $shortName = $_COOKIE['language']; } if ($shortName !== false) { $language = Language::getLanguage($shortName); } else { $language = $this->getDefaultLanguage(); } } if ($language instanceof Language) { $this->language = $language; $this->setLanguage($language); } else { throw new InvalidArgumentException("Argument should be instanse of Language"); } }
public function __construct(Config $config, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); if (isset($config->logMinutes)) { $this->logMinutes = $config->logMinutes; } }
public function __construct(Config $config, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); if (isset($config->sessionClearTimeout)) { $this->sessionClearTimeout = $config->sessionClearTimeout; } }
public function __construct($dbInstanceKey = null) { parent::__construct($dbInstanceKey); $this->remoteIp = $_SERVER["REMOTE_ADDR"]; if (empty($this->remoteIp) and !Cgi::getMode()) { throw new RuntimeException("Could not determine client ip address."); } }
public function __construct(Host $host, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); if (empty($host->host)) { throw new InvalidArgumentException("\$host have to be non empty Host object"); } $this->host = $host; }
public function __construct($lang_id = null, $cacheMinutes = null) { parent::__construct(); if ($lang_id !== null) { if (!is_numeric($lang_id)) { throw new InvalidIntegerArgumentException("lang_id argument should be an integer."); } $this->query->exec("SELECT * FROM `" . Tbl::get('TBL_LANGUAGES') . "` WHERE `id` = '{$lang_id}'", $cacheMinutes); if ($this->query->countRecords()) { $data = $this->query->fetchRecord(); static::setData($data, $this); } else { throw new RuntimeException("Wrong languge id is given. No record with id: {$lang_id} in table " . Tbl::get('TBL_LANGUAGES')); } } }
public function __construct($lang_id = null, $cacheMinutes = null) { parent::__construct(); if ($lang_id !== null) { if (!is_numeric($lang_id)) { throw new InvalidIntegerArgumentException("lang_id argument should be an integer."); } $qb = new QueryBuilder(); $qb->select(new Field('*'))->from(Tbl::get('TBL_LANGUAGES'))->where($qb->expr()->equal(new Field('id'), $lang_id)); $this->query->exec($qb->getSQL(), $cacheMinutes); if ($this->query->countRecords()) { $data = $this->query->fetchRecord(); static::setData($data, $this); } else { throw new RuntimeException("Wrong languge id is given. No record with id: {$lang_id} in table " . Tbl::get('TBL_LANGUAGES')); } } }
public function __construct(Host $host, Language $language, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); $this->host = $host; $this->language = $language; }
public function __construct(Config $config, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); $this->config = $config; }
public function __construct($dbInstanceKey = null) { parent::__construct($dbInstanceKey); }
public function __construct(Config $config, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); $this->config = $config; $this->um = Reg::get(ConfigManager::getConfig("Users", "Users")->Objects->UserManager); }
public function __construct(UserManagement $um, Config $config, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); $this->um = $um; $this->config = $config; }
/** * Class contructor * @param var $usr * @param var $sessionVar */ public function __construct(Config $config, $dbInstanceKey = null) { parent::__construct($dbInstanceKey); $this->authYubikey = new Yubikey($config->yubico_id, $config->yubico_key); }
public function __construct($tableName, $dbConnection = null) { parent::__construct($dbConnection); $this->tableName = $tableName; }