api/MarkLogic/MLPHP/ElementQueryConstraint.php
public function getAsElem($dom)
    {
        $constElem = $dom->createElement('constraint');
        $constElem->setAttribute('name', $this->name);
        $eqElem = $dom->createElement('element-query');
        $eqElem->setAttribute('ns', $this->ns);
        $eqElem->setAttribute('name', $this->elem);
        $constElem->appendChild($eqElem);
        /* <constraint name='sample-element-constraint'>
              <element-query name='title' ns='http://my/namespace' />
         </constraint> */
        return $constElem;
    }
public function getAsElem($dom)
    {
        $constElem = $dom->createElement('constraint');
        $constElem->setAttribute('name', $this->name);
        $eqElem = $dom->createElement('element-query');
        $eqElem->setAttribute('ns', $this->ns);
        $eqElem->setAttribute('name', $this->elem);
        $constElem->appendChild($eqElem);
        /* <constraint name='sample-element-constraint'>
              <element-query name='title' ns='http://my/namespace' />
         </constraint> */
        return $constElem;
    }
Get the constraint as a DOMElement object.

@param DOMDocument $dom The DOMDocument object with which to create the element.