public function joinSchemas(array $schemas)
    {
        foreach ($schemas as $schema) {
            foreach ($schema->getDatabases(false) as $addDb) {
                $addDbName = $addDb->getName();
                if ($this->hasDatabase($addDbName)) {
                    $db = $this->getDatabase($addDbName, false);
                    // temporarily reset database namespace to avoid double namespace decoration (see ticket #1355)
                    $namespace = $db->getNamespace();
                    $db->setNamespace(null);
                    // join tables
                    foreach ($addDb->getTables() as $addTable) {
                        if ($db->getTable($addTable->getName())) {
                            throw new EngineException(sprintf('Duplicate table found: %s.', $addTable->getName()));
                        }
                        $db->addTable($addTable);
                    }
                    // join database behaviors
                    foreach ($addDb->getBehaviors() as $addBehavior) {
                        if (!$db->hasBehavior($addBehavior->getId())) {
                            $db->addBehavior($addBehavior);
                        }
                    }
                    // restore the database namespace
                    $db->setNamespace($namespace);
                } else {
                    $this->addDatabase($addDb);
                }
            }
        }
    }
public function joinSchemas(array $schemas)
    {
        foreach ($schemas as $schema) {
            foreach ($schema->getDatabases(false) as $addDb) {
                $addDbName = $addDb->getName();
                if ($this->hasDatabase($addDbName)) {
                    $db = $this->getDatabase($addDbName, false);
                    // temporarily reset database namespace to avoid double namespace decoration (see ticket #1355)
                    $namespace = $db->getNamespace();
                    $db->setNamespace(null);
                    // join tables
                    foreach ($addDb->getTables() as $addTable) {
                        if ($db->getTable($addTable->getName())) {
                            throw new EngineException(sprintf('Duplicate table found: %s.', $addTable->getName()));
                        }
                        $db->addTable($addTable);
                    }
                    // join database behaviors
                    foreach ($addDb->getBehaviors() as $addBehavior) {
                        if (!$db->hasBehavior($addBehavior->getId())) {
                            $db->addBehavior($addBehavior);
                        }
                    }
                    // restore the database namespace
                    $db->setNamespace($namespace);
                } else {
                    $this->addDatabase($addDb);
                }
            }
        }
    }
public function joinSchemas ( array $ schemas ) { foreach ( $ schemas as $ schema ) { foreach ( $ schema -> getDatabases ( false ) as $ addDb ) { $ addDbName = $ addDb -> getName ( ) ; if ( $ this -> hasDatabase ( $ addDbName ) ) { $ db = $ this -> getDatabase ( $ addDbName , false ) ; // temporarily reset database namespace to avoid double namespace decoration (see ticket #1355) $ namespace = $ db -> getNamespace ( ) ; $ db -> setNamespace ( null ) ; // join tables foreach ( $ addDb -> getTables ( ) as $ addTable ) { if ( $ db -> getTable ( $ addTable -> getName ( ) ) ) { throw new EngineException ( sprintf ( 'Duplicate table found: %s.' , $ addTable -> getName ( ) ) ) ; } $ db -> addTable ( $ addTable ) ; } // join database behaviors foreach ( $ addDb -> getBehaviors ( ) as $ addBehavior ) { if ( ! $ db -> hasBehavior ( $ addBehavior -> getId ( ) ) ) { $ db -> addBehavior ( $ addBehavior ) ; } } // restore the database namespace $ db -> setNamespace ( $ namespace ) ; } else { $ this -> addDatabase ( $ addDb ) ; } } } }
Merge other Schema objects together into this Schema object.

@param Schema[] $schemas
Merge other Schema objects together into this Schema object .