public function setDomDocument(\DOMDocument $document)
    {
        if (isset($this->document) && $this->document !== $document) {
            throw new \Exception('Other DOMDocument already set!');
        }

        $this->document = $document;
    }
public function setDomDocument(\DOMDocument $document)
    {
        if (isset($this->document) && $this->document !== $document) {
            throw new \Exception('Other DOMDocument already set!');
        }

        $this->document = $document;
    }
public function setDomDocument ( \ DOMDocument $ document ) { if ( isset ( $ this -> document ) && $ this -> document !== $ document ) { throw new \ Exception ( 'Other DOMDocument already set!' ) ; } $ this -> document = $ document ; }
Set dom document

@param \DOMDocument $document

@return void
@throws \Exception if other document is already set
Set dom document