public function find($query) { $query = self::parseQuery($query); if ($this->xpath == null) { $this->xpath = new DOMXPath($this->ownerDocument); } $domNodeList = $this->xpath->query($query, $this->domElement); return DrPublishDomElementList::convertDomNodeList($domNodeList); }
public function find($query, $asArray = false) { if ($this->dom === null) { $this->initDom(); } $query = DrPublishDomElement::parseQuery($query); $domNodeList = $this->xpath->query($query); if ($asArray) { $out = array(); foreach ($domNodeList as $domElement) { $out[] = $domElement; } return $out; } return DrPublishDomElementList::convertDomNodeList($domNodeList); }