/** * * Sets the model stack. * * @param array $classes An array of class prefixes to use for the model * stack. * * @return void * */ protected function _setStack($classes) { if (!$classes) { // add per the vendor on this catalog and its inheritance $parents = Solar_Class::parents(get_class($this), true); array_shift($parents); // Solar_Base $old_vendor = false; foreach ($parents as $class) { $new_vendor = Solar_Class::vendor($class); if ($new_vendor != $old_vendor) { $classes[] = "{$new_vendor}_Model"; } $old_vendor = $new_vendor; } } // build the class stack $this->_stack = Solar::factory('Solar_Class_Stack'); $this->_stack->add($classes); }
/** * * Post-construction tasks to complete object construction. * * @return void * */ protected function _postConstruct() { parent::_postConstruct(); // set convenience vars from config $this->_default = (string) $this->_config['default']; $this->_disable = (array) $this->_config['disable']; $this->_routing = (array) $this->_config['routing']; // set up a class stack for finding apps $this->_stack = Solar::factory('Solar_Class_Stack'); $this->_stack->add($this->_config['classes']); // extended setup $this->_setup(); }
/** * * Add to the filter class stack. * * @param string|array $list The classes to add to the stack. * * @return void * * @see Solar_Class_Stack::add() * */ public function addFilterClass($list) { $this->_stack->add($list); }
/** * * Post-construction tasks to complete object construction. * * @return void * */ protected function _postConstruct() { parent::_postConstruct(); // set string var from config if ($this->_config['default']) { $this->_default = (string) $this->_config['default']; } // merge array vars from config $vars = array('disable', 'routing'); foreach ($vars as $key) { if ($this->_config[$key]) { $var = "_{$key}"; $this->{$var} = array_merge($this->{$var}, (array) $this->_config[$key]); } } // set up a class stack for finding apps $this->_stack = Solar::factory('Solar_Class_Stack'); $this->_stack->add($this->_config['classes']); // retain the registered rewriter $this->_rewrite = Solar_Registry::get('rewrite'); // merge our rewrite rules if ($this->_config['rewrite']) { $this->_rewrite->mergeRules($this->_config['rewrite']); } // merge our rewrite replacement tokens if ($this->_config['replace']) { $this->_rewrite->mergeReplacements($this->_config['replace']); } // extended setup $this->_setup(); }
/** * * Add to the helper class stack. * * @param string|array $list The classes to add to the stack. * * @return void * * @see Solar_Class_Stack::add() * */ public function addHelperClass($list) { $this->_helper_class->add($list); }