JDatabaseFactory
Joomla Platform Database Factory class
since |
3.0.0 |
---|---|
package |
Joomla.Platform |
Methods
getDriver
Method to return a JDatabaseDriver instance based on the given options. 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.
getDriver(string $name = 'mysqli', array $options = array()) : \JDatabaseDriver
Instances are unique to the given options and new objects are only created when a unique options array is passed into the method. This ensures that we don't end up with unnecessary database connection resources.
since |
3.0.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
\JDatabaseDriver
A database driver object.
getExporter
Gets an exporter class object.
getExporter(string $name, \JDatabaseDriver $db = null) : \JDatabaseExporter
since |
3.0.0 |
---|---|
throws |
|
Arguments
- $name
string
Name of the driver you want an exporter for.- $db
\JDatabaseDriver
Optional JDatabaseDriver instance
Response
\JDatabaseExporter
An exporter object.
getImporter
Gets an importer class object.
getImporter(string $name, \JDatabaseDriver $db = null) : \JDatabaseImporter
since |
3.0.0 |
---|---|
throws |
|
Arguments
- $name
string
Name of the driver you want an importer for.- $db
\JDatabaseDriver
Optional JDatabaseDriver instance
Response
\JDatabaseImporter
An importer object.
getInstance
Gets an instance of the factory object.
getInstance() : \JDatabaseFactory
getQuery
Get the current query object or a new JDatabaseQuery object.
getQuery(string $name, \JDatabaseDriver $db = null) : \JDatabaseQuery
since |
3.0.0 |
---|---|
throws |
|
Arguments
- $name
string
Name of the driver you want an query object for.- $db
\JDatabaseDriver
Optional JDatabaseDriver instance
Response
\JDatabaseQuery
The current query object or a new object extending the JDatabaseQuery class.
setInstance
Gets an instance of a factory object to return on subsequent calls of getInstance.
setInstance(\JDatabaseFactory $instance = null) : void
Properties
_instance
Contains the current JDatabaseFactory instance