我正在尝试在任务中设置 Doctrine 属性,但它似乎不起作用。
我要设置的是禁用 Doctrine 验证的属性:
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase('doctrine')->getConnection();
$connection->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_NONE);
但它不起作用,因为我正在创建一个新记录,其值由于 minlength 规则而无法验证,并且它显示验证错误。
我究竟做错了什么?