protected function cloneDatabase($db) { $attributes = array('name' => $db->getName(), 'baseClass' => $db->getBaseClass(), 'basePeer' => $db->getBasePeer(), 'defaultIdMethod' => $db->getDefaultIdMethod(), 'defaultPhpNamingMethod' => $db->getDefaultPhpNamingMethod(), 'defaultTranslateMethod' => $db->getDefaultTranslateMethod()); $clone = new DatabasePropel(); $clone->loadFromXML($attributes); return $clone; }
/** * Add a database to the list and sets the AppData property to this * AppData * * @param db the database to add */ public function addDatabase($db) { if ($db instanceof DatabasePropel) { $db->setAppData($this); if ($db->getPlatform() === null) { $db->setPlatform($this->platform); } $this->dbList[] = $db; return $db; } else { // XML attributes array / hash $d = new DatabasePropel(); $d->loadFromXML($db); return $this->addDatabase($d); // calls self w/ different param type } }