Example #1
0
 protected function setUp()
 {
     $elementData = array('group1' => array('id' => 1), 'group2' => array('id' => 2), 'group3' => array('id' => 3));
     $this->_flyweightMock = $this->getMock('Mage_Backend_Model_Config_Structure_Element_Group', array(), array(), '', false);
     $this->_model = new Mage_Backend_Model_Config_Structure_Element_Iterator($this->_flyweightMock);
     $this->_model->setElements($elementData, 'scope');
 }
Example #2
0
 /**
  * Set flyweight data
  *
  * @param array $data
  * @param string $scope
  */
 public function setData(array $data, $scope)
 {
     parent::setData($data, $scope);
     $children = array_key_exists('children', $this->_data) && is_array($this->_data['children']) ? $this->_data['children'] : array();
     $this->_childrenIterator->setElements($children, $scope);
 }