Pdo\Pgsql::setNoticeCallback
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Pdo\Pgsql::setNoticeCallback
Референца за `pdo-pgsql.setnoticecallback.php` со подобрена типографија и навигација.
Pdo\Pgsql::setNoticeCallback
Класата Dom\DtdNamedNodeMap
Pdo\Pgsql::setNoticeCallback — Set a callback to handle notice and warning messages generated by the backend
= NULL
Set a callback to handle notice and warning messages generated by the backend. This includes messages emitted by PostgreSQL itself, as well as those raised by user-defined SQL functions using RAISE. Please note that the actual receipt of these messages depends on the backend setting client_min_messages.
Параметри
callback-
Враќа
nullсе поминува, рачката се ресетира на својата стандардна состојба.Otherwise, the handler is a callback with the following signature:
message- A message generated by the backend.
Вратени вредности
Не се враќа вредност.
Примери
Пример #1 Pdo\Pgsql::setNoticeCallback() example
<?php
$pdo = new Pdo\Pgsql('pgsql:dbname=test host=localhost', $user, $pass);
$pdo->exec('CREATE TABLE parent(id int primary key)');
$pdo->exec('CREATE TABLE child(id int references parent)');
$pdo->setNoticeCallback(function ($message) {
echo $message;
});
$pdo->exec('TRUNCATE parent CASCADE');
?>Горниот пример ќе прикаже нешто слично на:
NOTICE: truncate cascades to table "child"