/** * @param $name * * @return Model\Document\Page */ public function getElement($name) { $id = sprintf('%s%s%d', $name, $this->name, $this->index); $element = $this->doc->getElement($id); $element->suffixes = array($this->name); return $element; }
/** * @param $name * * @return Model\Document\Tag */ public function getElement($name) { $root = $name . implode('_', $this->suffixes); foreach ($this->suffixes as $item) { if (preg_match('#[^\\d]{1}(?<index>[\\d]+)$#i', $item, $match)) { $root .= $match['index'] . '_'; } } $root .= $this->index; $id = $root; $element = $this->doc->getElement($id); if ($element) { $element->suffixes = $this->suffixes; } return $element; }