include/database/DBManagerFactory.php
\DBManagerFactory
Package: SugarCRM
Parameters
Returns
Returns
Database driver factory
- Api
- Instantiates and configures appropriate DB drivers
Properties
Methods
getDbDrivers(
bool $validate
=
true
)
:
array
static
Get list of all available DB drivers
Parameters
Returns
Name | Type | Description |
---|---|---|
$validate | bool | Return only valid drivers or all of them? |
Type | Description |
---|---|
array | List of Db drivers, key - variant (mysql, mysqli), value - driver type (mysql, mssql) |
getInstance(
string $instanceName
=
''
)
:
object
static
Returns a reference to the DB object for instance $instanceName, or the default instance if one is not specified
Parameters
Returns
Name | Type | Description |
---|---|---|
$instanceName | string | optional, name of the instance |
Type | Description |
---|---|
object | DBManager instance |
getManagerByType(
string $type, bool $validate
=
true
)
:
string
static
Get DB manager class name by type name
For use in install
Name | Type | Description |
---|---|---|
$type | string | |
$validate | bool | Return only valid drivers or any? |
Type | Description |
---|---|
string |
getTypeInstance(
string $type, array $config
=
array()
)
:
object
static
Returns a reference to the DB object of specific type
Parameters
Returns
Name | Type | Description |
---|---|---|
$type | string | DB type |
$config | array | DB configuration |
Type | Description |
---|---|
object | DBManager instance |
isFreeTDS(
)
:
bool
static
Check if we have freeTDS driver installed Invoked when connected to mssql. checks if we have freetds version of mssql library.
the response is put into a global variable.
Type | Description |
---|---|
bool |