Example #1
0
 /**
  * @param null|string $sibling
  *
  * @return Element|Tag|Field
  */
 public function before($sibling = null)
 {
     $prev = $this->previousSibling;
     if (is_null($sibling)) {
         if ($prev) {
             return $prev;
         }
         return $this;
     }
     return $this->parent()->insertBefore($this->ownerDocument->importNode($this->ownerDocument->check($sibling)), $this);
 }
Example #2
0
File: Cdata.php Project: volux/dom
 /**
  * @param $element
  *
  * @return Element|Field|Tag
  */
 public function before($element)
 {
     return $this->parent()->insertBefore($this->ownerDocument->importNode($this->ownerDocument->check($element)), $this);
 }