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( name = 'mysqli', mixed||string|int 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

UnsupportedAdapterExceptionif there is not a compatible database driver

Arguments

name

stringName of the database driver you'd like to instantiate

options

array<string|int, mixed>Parameters to be passed to the database driver.

Response

DatabaseInterface

getExporter

Gets an exporter class object.

getExporter( name, \Joomla\Database\DatabaseInterface|null db = null) : \Joomla\Database\DatabaseExporter
since

1.0

throws

UnsupportedAdapterExceptionif there is not a compatible database exporter

Arguments

name

stringName of the driver you want an exporter for.

db

DatabaseInterface|nullOptional database driver to inject into the query object.

Response

DatabaseExporter

getImporter

Gets an importer class object.

getImporter( name, \Joomla\Database\DatabaseInterface|null db = null) : \Joomla\Database\DatabaseImporter
since

1.0

throws

UnsupportedAdapterExceptionif there is not a compatible database importer

Arguments

name

stringName of the driver you want an importer for.

db

DatabaseInterface|nullOptional database driver to inject into the query object.

Response

DatabaseImporter

getIterator

Get a new iterator on the current query.

getIterator( name, \Joomla\Database\StatementInterface statement, string|null column = null,  class = stdClass::class) : \Joomla\Database\DatabaseIterator
since

2.0.0

Arguments

name

stringName of the driver you want an iterator for.

statement

StatementInterfaceStatement holding the result set to be iterated.

column

string|nullAn optional column to use as the iterator key.

class

stringThe class of object that is returned.

Response

DatabaseIterator

getQuery

Get the current query object or a new Query object.

getQuery( name, \Joomla\Database\DatabaseInterface|null db = null) : \Joomla\Database\QueryInterface
since

1.0

throws

UnsupportedAdapterExceptionif there is not a compatible database query object

Arguments

name

stringName of the driver you want an query object for.

db

DatabaseInterface|nullOptional database driver to inject into the query object.

Response

QueryInterface