DB_DataObject::debugLevel

DB_DataObject::debugLevel – set the amount of debugging output

Synopsis

void DB_DataObject::debugLevel ( integer $level )

Description

Sets and returns debug level. So you can see the queries and connections being built and executed.

Parameter

  • integer $level - level, without any parameters it will disable the debugging output. 1 give a general output, 5 includes things like passwords for connections.

Note

This function can not be called statically.

Example

Using debugLevel()

<?php
// turn debugging high
DB_DataObject::debugLevel(5);
$person = new DataObjects_Person;
$person->get(12);
$person->setFrom($_POST['input']);
$person->update();
// turn debugging off
DB_DataObject::debugLevel();
?>
Get the PEAR Database Result Object (Previous) output debug information. (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:

Note by: delatbabel@spamgourmet.com
Undocumented feature: You can set debugLevel to a callable function, e.g.

'myDebugFunction'

or

array('myDebugClass', 'myDebugMethod')

Then the function will be called by DB_DataObject's debug method. See the note on debug().

Del