/** * Set portal config. * * @throws InvalidArgumentException */ protected function setConfig() { $config = $this->yii->params['portal']; if (!$config) { throw new InvalidArgumentException('Missing portal configuration for ' . __CLASS__); } foreach (static::$required_config_keys as $k) { if (Helper::elementFinder($k, $config) === null) { throw new InvalidArgumentException('Missing required config parameter for ' . __CLASS__); } } $this->config = $config; }
/** * Simple abstraction to pull a param from yii config separated by dots. * @param $config * @param $key * @return null */ private function getParamAttribute($config, $key) { return Helper::elementFinder($key, $config); }