1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/manual/codes/Configuration - Levels of configuration.php

21 lines
585 B
PHP

<?php
// setting a global level attribute
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_VLD, false);
// setting a connection level attribute
// (overrides the global level attribute on this connection)
$conn = $manager->openConnection(new PDO('dsn', 'username', 'pw');
$conn->setAttribute(Doctrine::ATTR_VLD, true);
// setting a table level attribute
// (overrides the connection/global level attribute on this table)
$table = $conn->getTable('User');
$table->setAttribute(Doctrine::ATTR_LISTENER, new UserListener());
?>