You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2021. It is now read-only.
When a class is generated, the method "getConnection" looks like the following.
/** * @param null|string $name - The data source name that is used to look up the DSN from the runtime configuration file. * @param string $mode The connection mode (this applies to replication systems). * @return PDO */publicfunctiongetConnection($name = null, $mode = Propel::CONNECTION_WRITE)
{
returnPropel::getConnection($name, $mode);
}
It can happen that you are using multiple databases resulting in multiple generated classes.
To still be able to get the right connection without passing around the name, it would be good to configure the default name. If the default name is configured, the generated method could look like that.
/** * @param null|string $name - The data source name that is used to look up the DSN from the runtime configuration file. * @param string $mode The connection mode (this applies to replication systems). * @return PDO */publicfunctiongetConnection($name = null, $mode = Propel::CONNECTION_WRITE)
{
if (is_null($name)) {
$name = 'my_configured_default_value';
}
returnPropel::getConnection($name, $mode);
}
The same could be done for the value "$mode".
The text was updated successfully, but these errors were encountered:
When a class is generated, the method "getConnection" looks like the following.
It can happen that you are using multiple databases resulting in multiple generated classes.
To still be able to get the right connection without passing around the name, it would be good to configure the default name. If the default name is configured, the generated method could look like that.
The same could be done for the value "$mode".
The text was updated successfully, but these errors were encountered: