views:

20

answers:

0

I'm trying to set a Doctrine attribute in a task, but it doesn't seem to work.

What I'm trying to set, is an attribute to disable Doctrine validation:

$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase('doctrine')->getConnection();
$connection->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_NONE);

But it doesn't work, because I'm creating a new record with a value that doesn't validate because of a minlength rule, and it displays a validation error.

What am I doing wrong?