I am using Phalcon Framework with mysql and mongo database connection for each type of model. We have created a mongo translation system associated with models to save related translations in mongo db, in addition to the mysql model information.
Using the mysql model, expanding \ Phalcon \ Mvc \ Model , I can access the database name and other information using the connection service model associated with the model, for example:
$src->getReadConnection()->getDescriptor()['dbname'];
where $ src is my Phalcon \ Mvc \ Model
But when I try to use models that extend \ Phalcon \ Mvc \ Collection , I could not find a way to access the database name, I tried to do this using phalcon \ mvc \ collection methods, such as:
Abstract class Phalcon\Mvc\Collection
public setConnectionService (unknown $connectionService)
Sets the DependencyInjection connection service name
public getConnectionService ()
Returns DependencyInjection connection service
public MongoDb getConnection ()
Retrieves a database connection
. , \Phalcon\Mvc\Model