protected function mergeDatabaseElement(\DOMElement $sourceDatabaseElement)
    {
        $database = $this->getDatabaseFromDatabaseElement($sourceDatabaseElement);

        $this->initGlobalDatabaseElement($database);

        $globalDatabaseElement = $this->globalDatabaseElements[$database];

        // add a source schema start marker
        $fileStartMarkerComment = $globalDatabaseElement->ownerDocument->createComment(
            "Start of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'"
        );
        $globalDatabaseElement->appendChild($fileStartMarkerComment);

        // merge the element
        foreach ($sourceDatabaseElement->childNodes as $childNode) {
            $importedNode = $globalDatabaseElement->ownerDocument->importNode($childNode, true);
            $globalDatabaseElement->appendChild($importedNode);
        }

        // and a source schema end marker
        $fileEndMarkerComment = $globalDatabaseElement->ownerDocument->createComment(
            "End of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'"
        );
        $globalDatabaseElement->appendChild($fileEndMarkerComment);

        $this->sourceDatabaseElements[$database][] = $sourceDatabaseElement;
    }
protected function mergeDatabaseElement(\DOMElement $sourceDatabaseElement)
    {
        $database = $this->getDatabaseFromDatabaseElement($sourceDatabaseElement);

        $this->initGlobalDatabaseElement($database);

        $globalDatabaseElement = $this->globalDatabaseElements[$database];

        // add a source schema start marker
        $fileStartMarkerComment = $globalDatabaseElement->ownerDocument->createComment(
            "Start of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'"
        );
        $globalDatabaseElement->appendChild($fileStartMarkerComment);

        // merge the element
        foreach ($sourceDatabaseElement->childNodes as $childNode) {
            $importedNode = $globalDatabaseElement->ownerDocument->importNode($childNode, true);
            $globalDatabaseElement->appendChild($importedNode);
        }

        // and a source schema end marker
        $fileEndMarkerComment = $globalDatabaseElement->ownerDocument->createComment(
            "End of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'"
        );
        $globalDatabaseElement->appendChild($fileEndMarkerComment);

        $this->sourceDatabaseElements[$database][] = $sourceDatabaseElement;
    }
protected function mergeDatabaseElement ( \ DOMElement $ sourceDatabaseElement ) { $ database = $ this -> getDatabaseFromDatabaseElement ( $ sourceDatabaseElement ) ; $ this -> initGlobalDatabaseElement ( $ database ) ; $ globalDatabaseElement = $ this -> globalDatabaseElements [ $ database ] ; // add a source schema start marker $ fileStartMarkerComment = $ globalDatabaseElement -> ownerDocument -> createComment ( "Start of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'" ) ; $ globalDatabaseElement -> appendChild ( $ fileStartMarkerComment ) ; // merge the element foreach ( $ sourceDatabaseElement -> childNodes as $ childNode ) { $ importedNode = $ globalDatabaseElement -> ownerDocument -> importNode ( $ childNode , true ) ; $ globalDatabaseElement -> appendChild ( $ importedNode ) ; } // and a source schema end marker $ fileEndMarkerComment = $ globalDatabaseElement -> ownerDocument -> createComment ( "End of schema from '{$sourceDatabaseElement->ownerDocument->baseURI}'" ) ; $ globalDatabaseElement -> appendChild ( $ fileEndMarkerComment ) ; $ this -> sourceDatabaseElements [ $ database ] [ ] = $ sourceDatabaseElement ; }
Merge a source database element into the corresponding global database element for this database.
@param \DOMElement $sourceDatabaseElement Source database element to merge.
Merge a source database element into the corresponding global database element for this database .