/** * Take all nodes in the current object and prepend them to the children nodes of * each matched node in the passed-in DOMQuery object. * * This will iterate through each item in the current DOMQuery object and * add each item to the beginning of the children of each element in the * passed-in DOMQuery object. * * @see insertBefore() * @see insertAfter() * @see prepend() * @see appendTo() * @param DOMQuery $dest * The destination DOMQuery object. * @retval object DOMQuery * The original DOMQuery, unmodified. NOT the destination DOMQuery. * @throws QueryPath::Exception * Thrown if $data is an unsupported object type. */ public function prependTo(DOMQuery $dest) { foreach ($this->matches as $m) { $dest->prepend($m); } return $this; }