public function testGetPathBuildsFullPath() { $this->_model->setData(['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 * @return void */ 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'] : []; $this->_childrenIterator->setElements($children, $scope); }
/** * Initialize current flyweight * * @param array $element * @return void */ protected function _initFlyweight(array $element) { $this->_flyweight->setData($element, $this->_scope); }