symfony API

sfDatabaseManager Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfDatabaseManager allows you to setup your database connectivity before the

Method Summary

  • mixed getDatabase($name)
    Retrieves the database connection associated with this sfDatabase implementation.
  • array getNames()
    Returns the names of all database connections.
  • bool initialize($configuration)
    Initializes this sfDatabaseManager object
  • loadConfiguration()
    Loads database configuration.
  • setDatabase($name, $database)
    Sets a database connection.
  • void shutdown()
    Executes the shutdown procedure
  • __construct()
    Class constructor.

Method Details

  • (mixed) getDatabase ($name)

    $name A database name

    Retrieves the database connection associated with this sfDatabase implementation.

    returns A Database instance

    throws sfDatabaseException If the requested database name does not exist

  • (array) getNames ()

    Returns the names of all database connections.

    returns An array containing all database connection names

  • (bool) initialize ($configuration)

    $configuration A sfProjectConfiguration instance

    Initializes this sfDatabaseManager object

    returns true, if initialization completes successfully, otherwise false

    throws sfInitializationException If an error occurs while initializing this sfDatabaseManager object

  • loadConfiguration ()

    Loads database configuration.

  • setDatabase ($name, $database)

    $name The database name
    $database A sfDatabase instance

    Sets a database connection.

  • (void) shutdown ()

    Executes the shutdown procedure

    throws sfDatabaseException If an error occurs while shutting down this DatabaseManager

  • __construct ()

    Class constructor.