/** * Gibt den vorhandenen oder durch die Callback gesetzten Index zurück * @param string $index * @return mixed */ public function offsetGet($index) { if (!parent::offsetExists($index)) { if (!isset($this->_callbacks[$index])) { throw new Dragon_Application_Exception_System('incorrect index'); } parent::offsetSet($index, $this->_callbacks[$index]()); } return parent::offsetGet($index); }
public function offsetGet($index) { if ($index == 'db' && !parent::offsetExists($index)) { $v = Kwf_Setup::createDb(); $this->offsetSet('db', $v); return $v; } else { if ($index == 'config' && !parent::offsetExists($index)) { $v = Kwf_Config_Web::getInstance(); $this->offsetSet('config', $v); return $v; } else { if ($index == 'dao' && !parent::offsetExists($index)) { $v = Kwf_Setup::createDao(); $this->offsetSet('dao', $v); return $v; } else { if ($index == 'acl' && !parent::offsetExists($index)) { $v = Kwf_Acl::getInstance(); $this->offsetSet('acl', $v); return $v; } else { if ($index == 'userModel' && !parent::offsetExists($index)) { $v = self::get('config')->user->model; if ($v) { $v = Kwf_Model_Abstract::getInstance($v); } $this->offsetSet('userModel', $v); return $v; } else { if ($index == 'trl' && !parent::offsetExists($index)) { $v = Kwf_Trl::getInstance(); $this->offsetSet('trl', $v); return $v; } } } } } } return parent::offsetGet($index); }
public function offsetGet($index) { if (isset($this->_map[$index])) { $index = $this->_map[$index]; } if (array_key_exists($index, $this)) { return parent::offsetGet($index); } else { if (isset($this->_serviceLocator) && $this->_serviceLocator->hasForRegistry($index)) { $this->offsetSet($index, $this->_serviceLocator->loadForRegistry($index)); return parent::offsetGet($index); } else { return null; } } }
public function __get($name) { return $this->_parameters->offsetGet($name); }