DatabaseFactory
Joomla Framework Database Factory class
since |
1.0 |
---|---|
package |
Joomla Framework |
Methods
getDriver
Method to return a database driver based on the given options.
getDriver(string name = 'mysqli', array options = []) : \Joomla\Database\DatabaseInterface
There are three global options and then the rest are specific to the database driver. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.
since |
1.0 |
---|---|
throws |
|
Arguments
- name
string
Name of the database driver you'd like to instantiate- options
array
Parameters to be passed to the database driver.
Response
\Joomla\Database\DatabaseInterface
getExporter
Gets an exporter class object.
getExporter(string name, \Joomla\Database\DatabaseInterface|null db = null) : \Joomla\Database\DatabaseExporter
since |
1.0 |
---|---|
throws |
|
Arguments
- name
string
Name of the driver you want an exporter for.- db
\Joomla\Database\DatabaseInterface|null
Optional database driver to inject into the query object.
Response
\Joomla\Database\DatabaseExporter
getImporter
Gets an importer class object.
getImporter(string name, \Joomla\Database\DatabaseInterface|null db = null) : \Joomla\Database\DatabaseImporter
since |
1.0 |
---|---|
throws |
|
Arguments
- name
string
Name of the driver you want an importer for.- db
\Joomla\Database\DatabaseInterface|null
Optional database driver to inject into the query object.
Response
\Joomla\Database\DatabaseImporter
getIterator
Get a new iterator on the current query.
getIterator(string name, \Joomla\Database\StatementInterface statement, string|null column = null, string class = stdClass::class) : \Joomla\Database\DatabaseIterator
since |
2.0.0 |
---|
Arguments
- name
string
Name of the driver you want an iterator for.- statement
\Joomla\Database\StatementInterface
Statement holding the result set to be iterated.- column
string|null
An optional column to use as the iterator key.- class
string
The class of object that is returned.
Response
\Joomla\Database\DatabaseIterator
getQuery
Get the current query object or a new Query object.
getQuery(string name, \Joomla\Database\DatabaseInterface|null db = null) : \Joomla\Database\QueryInterface
since |
1.0 |
---|---|
throws |
|
Arguments
- name
string
Name of the driver you want an query object for.- db
\Joomla\Database\DatabaseInterface|null
Optional database driver to inject into the query object.
Response
\Joomla\Database\QueryInterface