Class JDatabaseFactory

Description

Joomla Platform Database Factory class

  • since: 12.1

Located in /libraries/joomla/database/factory.php (line 19)


	
			
Method Summary
 static void setInstance ([JDatabaseFactory $instance = null])
 JDatabaseDriver getDriver ([string $name = 'mysqli'], [array $options = array()])
 JDatabaseExporter getExporter (string $name, [JDatabaseDriver $db = null])
 JDatabaseImporter getImporter (string $name, [JDatabaseDriver $db = null])
 JDatabaseQuery getQuery (string $name, [JDatabaseDriver $db = null])
Methods
static getInstance (line 148)

Gets an instance of the factory object.

  • since: 12.1
  • access: public
static JDatabaseFactory getInstance ()
static setInstance (line 188)

Gets an instance of a factory object to return on subsequent calls of getInstance.

  • since: 12.1
  • access: public
static void setInstance ([JDatabaseFactory $instance = null])
getDriver (line 46)

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.

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.

  • return: A database driver object.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseDriver getDriver ([string $name = 'mysqli'], [array $options = array()])
  • string $name: Name of the database driver you'd like to instantiate
  • array $options: Parameters to be passed to the database driver.
getExporter (line 86)

Gets an exporter class object.

  • return: An exporter object.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseExporter getExporter (string $name, [JDatabaseDriver $db = null])
  • string $name: Name of the driver you want an exporter for.
  • JDatabaseDriver $db: Optional JDatabaseDriver instance
getImporter (line 119)

Gets an importer class object.

  • return: An importer object.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseImporter getImporter (string $name, [JDatabaseDriver $db = null])
  • string $name: Name of the driver you want an importer for.
  • JDatabaseDriver $db: Optional JDatabaseDriver instance
getQuery (line 164)

Get the current query object or a new JDatabaseQuery object.

  • return: The current query object or a new object extending the JDatabaseQuery class.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseQuery getQuery (string $name, [JDatabaseDriver $db = null])
  • string $name: Name of the driver you want an query object for.
  • JDatabaseDriver $db: Optional JDatabaseDriver instance

Documentation generated on Tue, 19 Nov 2013 15:02:47 +0100 by phpDocumentor 1.4.3