/** * Insert the current elements into the destination document. * The items are inserted before each element in the given DOMQuery document. * That is, they will be siblings with the current elements. * * @param DOMQuery $dest * Destination DOMQuery document. * @retval object DOMQuery * The current DOMQuery object, unaltered. Only the destination DOMQuery * object is altered. * @see before() * @see insertAfter() * @see appendTo() * @throws QueryPath::Exception * Thrown if $data is an unsupported object type. */ public function insertBefore(DOMQuery $dest) { foreach ($this->matches as $m) { $dest->before($m); } return $this; }