setOptions($options); } public static function getInstance() { if (null === Qs_Acl::$_instance) { $config = Zend_Registry::get('config'); $options = isset($config->acl) ? $config->acl->toArray() : array(); Qs_Acl::$_instance = new Qs_Acl($options); } } public function setOptions($options) { if (isset($options['options'])) { unset($options['options']); } if (isset($options['roles'])) { foreach ($options['roles'] as $role) { $this->addRole($role); } unset($options['roles']); } foreach ($options as $key => $value) { $this->setOption($key, $value); } return $this; } public function setOption($name, $value) { $method = 'set' . ucfirst($name); if (method_exists($this, $method)) { $this->$method($value); } return $this; } public function setEnabled($flag = true) { $this->_enabled = (bool) $flag; return $this; } public function isEnabled() { return $this->_enabled; } }