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);
 }
Esempio n. 2
0
 protected function getHtmlFromToken(Token $token)
 {
     return $token->toHtml('', "\n");
 }
Esempio n. 3
0
 /**
  * Required by ContainsChildren interface.
  */
 public function prependChild(Token $token)
 {
     $token->setParent($this);
     array_unshift($this->children, $token);
     return $this;
 }