public function addDatabase($database)
    {
        if ($database instanceof Database) {
            $platform = null;
            $database->setParentSchema($this);
            if (null === $database->getPlatform()) {
                if ($config = $this->getGeneratorConfig()) {
                    $platform = $config->getConfiguredPlatform(null, $database->getName());
                }

                $database->setPlatform($platform ? $platform : $this->platform);
            }
            $this->databases[] = $database;

            return $database;
        }

        // XML attributes array / hash
        $db = new Database();
        $db->setParentSchema($this);
        $db->loadMapping($database);

        return $this->addDatabase($db);
    }
public function addDatabase($database)
    {
        if ($database instanceof Database) {
            $platform = null;
            $database->setParentSchema($this);
            if (null === $database->getPlatform()) {
                if ($config = $this->getGeneratorConfig()) {
                    $platform = $config->getConfiguredPlatform(null, $database->getName());
                }

                $database->setPlatform($platform ? $platform : $this->platform);
            }
            $this->databases[] = $database;

            return $database;
        }

        // XML attributes array / hash
        $db = new Database();
        $db->setParentSchema($this);
        $db->loadMapping($database);

        return $this->addDatabase($db);
    }
public function addDatabase ( $ database ) { if ( $ database instanceof Database ) { $ platform = null ; $ database -> setParentSchema ( $ this ) ; if ( null === $ database -> getPlatform ( ) ) { if ( $ config = $ this -> getGeneratorConfig ( ) ) { $ platform = $ config -> getConfiguredPlatform ( null , $ database -> getName ( ) ) ; } $ database -> setPlatform ( $ platform ? $ platform : $ this -> platform ) ; } $ this -> databases [ ] = $ database ; return $ database ; } // XML attributes array / hash $ db = new Database ( ) ; $ db -> setParentSchema ( $ this ) ; $ db -> loadMapping ( $ database ) ; return $ this -> addDatabase ( $ db ) ; }
Adds a database to the list and sets the Schema property to this
Schema. The database can be specified as a Database object or a
DOMNode object.

@param  Database|array $database
@return Database
Adds a database to the list and sets the Schema property to this Schema . The database can be specified as a Database object or a DOMNode object .