->keys() – Get or set the table keys


array $DB_DataObject->keys ( string $keys ... )


Without any arguments, keys() returns an array of the keys used by the object (the generator builds these and guesses them based on finding things like primary key, unique, or nextval). Calling it with a value, or mulitple values, sets the keys for the current instance of the object.

The default keys are normally stored in the database.ini file described in the Autobuilding section.


This function can not be called statically.


getting the connection

= new DataObjects_Person;
// array(
//     0 => 'id',
// )


// now use it to define a on the fly database table...

$d = new DB_DataObject;

// if you have multiple keys
// $d->keys('id','key2','key2');

$d->id 12;
// should do the same as above..!
Get or set the table schema (Previous) Get the PEAR Database Object (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.