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
publicfunctiongetConnection(<CollectionInterface> model)
{
var service, connectionService, connection, dependencyInjector, entityName;
let service ="mongo";
let connectionService =this->_connectionServices;
iftypeof connectionService =="array" {
let entityName = get_class(model);
/** * Check if the model has a custom connection service*/ifisset connectionService[entityName] {
let service = connectionService[entityName];
}
}
let dependencyInjector =this->_dependencyInjector;
iftypeof dependencyInjector !="object" {
thrownewException("A dependency injector container is required to obtain the services related to the ORM");
}
/** * Request the connection service from the DI*/let connection = dependencyInjector->getShared(service);
iftypeof connection !="object" {
thrownewException("Invalid injected connection service");
}
return connection;
}
publicfunctiongetConnectionService(<CollectionInterface> model) ->string
{
var service, entityName;
let service ="mongo";
let entityName = get_class(model);
ifissetthis->_connectionServices[entityName] {
let service =this->_connectionServices[entityName];
}
return service;
}
Can you please use a settable variable for the connection service name instead of a hard coded string like "mongo" .
The text was updated successfully, but these errors were encountered:
Can you please use a settable variable for the connection service name instead of a hard coded string like "mongo" .
The text was updated successfully, but these errors were encountered: