/** * Initialize current flyweight * * @param array $element */ protected function _initFlyweight(array $element) { $this->_flyweight->setData($element, $this->_scope); }
public function testGetPathBuildsFullPath() { $this->_model->setData(array('path' => 'section/group', 'id' => 'fieldId'), 'scope'); $this->assertEquals('section/group/prefix_fieldId', $this->_model->getPath('prefix_')); }
/** * 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); }