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