symfony API

sfDatabaseManager Class

« Back to API menu

action

addon

cache

config

controller

countable

database

debug

exception

filter

generator

helper

i18n

log

request

response

storage

test

user

util

validator

view

You are currently browsing the symfony documentation for the 1.0 version. Switch to:

sfDatabaseManager allows you to setup your database connectivity before the request is handled. This eliminates the need for a filter to manage database connections.

Method Summary

  • shutdown()
    Executes the shutdown procedure
  • bool initialize()
    Initializes this sfDatabaseManager object
  • mixed getDatabase($name = 'default')
    Retrieves the database connection associated with this sfDatabase implementation.

Method Details

  • shutdown ()

    Executes the shutdown procedure

    throws sfDatabaseException If an error occurs while shutting down this DatabaseManager

  • (bool) initialize ()

    Initializes this sfDatabaseManager object

    returns true, if initialization completes successfully, otherwise false

    throws sfInitializationException If an error occurs while initializing this sfDatabaseManager object

  • (mixed) getDatabase ($name = 'default')

    $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