Example #1
0
 /**
  * Root elements that are not assigned to any section needs to be
  * on the top of config.
  *
  * @see    http://framework.zend.com/issues/browse/ZF-6289
  * @param  IfwPsn_Vendor_Zend_Config
  * @return IfwPsn_Vendor_Zend_Config
  */
 protected function _sortRootElements(IfwPsn_Vendor_Zend_Config $config)
 {
     $configArray = $config->toArray();
     $sections = array();
     // remove sections from config array
     foreach ($configArray as $key => $value) {
         if (is_array($value)) {
             $sections[$key] = $value;
             unset($configArray[$key]);
         }
     }
     // readd sections to the end
     foreach ($sections as $key => $value) {
         $configArray[$key] = $value;
     }
     return new IfwPsn_Vendor_Zend_Config($configArray);
 }
Example #2
0
 /**
  * Set options from config object
  *
  * @param  IfwPsn_Vendor_Zend_Config $config
  * @return IfwPsn_Vendor_Zend_Form_Decorator_Abstract
  */
 public function setConfig(IfwPsn_Vendor_Zend_Config $config)
 {
     return $this->setOptions($config->toArray());
 }
Example #3
0
 /**
  * Set options using an instance of type IfwPsn_Vendor_Zend_Config
  *
  * @param IfwPsn_Vendor_Zend_Config $config
  * @return IfwPsn_Vendor_Zend_Cache_Core
  */
 public function setConfig(IfwPsn_Vendor_Zend_Config $config)
 {
     $options = $config->toArray();
     while (list($name, $value) = each($options)) {
         $this->setOption($name, $value);
     }
     return $this;
 }