->database()

->database() – Get or set the database the object uses

Synopsis

object $DB_DataObject->database ( string $name )

Description

Without any argument, it returns the database that the object deals with. With a string, it will set the database for the instance of the object.

Note

This function can not be called statically.

Example

Getting the database name

<?php
$person 
= new DataObjects_Person;
echo 
$person->database();
// echo's mydatabase


// now use the same object to check on a mirror..

$person->database('mirror1');
$person->id 12;
$person->find(true);
?>
Get or set the table name of an object (Previous) Get or set the table schema (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.