/** * Creates method from app configuration * * @param string id * @param vBuilder\Config\ConfigDAO config * @param Nette\DI\IContainer DI context */ static function fromConfig($id, vBuilder\Config\ConfigDAO $config, Nette\DI\IContainer $context) { $method = new static(); $method->_id = $id; $method->_name = $config->get('name', $id); $method->_description = $config->get('description'); $method->_suitablePayments = $config->get('suitablePayments') ? $config->get('suitablePayments')->toArray() : null; return $method; }
/** * Creates method from app configuration * * @param string id * @param vBuilder\Config\ConfigDAO config * @param Nette\DI\IContainer DI context */ static function fromConfig($id, vBuilder\Config\ConfigDAO $config, Nette\DI\IContainer $context) { $method = new static(); $method->_id = $id; $method->_name = $config->get('name', $id); $method->_description = $config->get('description'); $method->_charge = $config->get('charge'); return $method; }
/** * Overloaded getter for load triggering * * @param string $key * @param mixed $default * @return mixed */ public function &get($key, $default = null) { if (!$this->isLoaded) { $this->load(); } return parent::get($key, $default); }