api/MarkLogic/MLPHP/FieldWordConstraint.php
public function getAsElem($dom)
    {
        $constElem = $dom->createElement('constraint');
        $constElem->setAttribute('name', $this->name);
        $fwordElem = $dom->createElement('word');
        $fieldElem = $dom->createElement('field');
        $fieldElem->setAttribute('name', $this->field);
        $fwordElem->appendChild($fieldElem);
        $this->addTermOptions($dom, $fwordElem);
        $constElem->appendChild($fwordElem);
        /* <constraint name='summary'>
                <word>
                  <field name='summary'/>
                </word>
           </constraint> */
        return $constElem;
    }
public function getAsElem($dom)
    {
        $constElem = $dom->createElement('constraint');
        $constElem->setAttribute('name', $this->name);
        $fwordElem = $dom->createElement('word');
        $fieldElem = $dom->createElement('field');
        $fieldElem->setAttribute('name', $this->field);
        $fwordElem->appendChild($fieldElem);
        $this->addTermOptions($dom, $fwordElem);
        $constElem->appendChild($fwordElem);
        /* <constraint name='summary'>
                <word>
                  <field name='summary'/>
                </word>
           </constraint> */
        return $constElem;
    }
Get the constraint as a DOMElement object.

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