public function hasAncestor(Element $element)
 {
     if ($this->parent === null) {
         return false;
     }
     if ($this->parent->getType() == Token::ELEMENT && $this->parent->getName() == $element->getName()) {
         return true;
     }
     return $this->parent->hasAncestor($element);
 }
Exemple #2
0
 protected function getHtmlFromToken(Token $token)
 {
     return $token->toHtml('', "\n");
 }
 /**
  * Required by ContainsChildren interface.
  */
 public function prependChild(Token $token)
 {
     $token->setParent($this);
     array_unshift($this->children, $token);
     return $this;
 }