0
我想利用這個代碼,它的flush()沒有任何異常的消息打破:Symfony2的&Doctrine2 PDOException沒有說明
1. at PDOStatement ->execute (null)
in ../vendor/doctrine-dbal/lib/Doctrine/DBAL/Statement.php at line 131
2. at Statement ->execute()
in ../vendor/doctrine/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php at line 237
3. at BasicEntityPersister ->executeInserts()
in ../vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php at line 726
4. at UnitOfWork ->executeInserts (object(ClassMetadata))
in ../vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php at line 292
5. at UnitOfWork ->commit()
in ../vendor/doctrine/lib/Doctrine/ORM/EntityManager.php at line 334
6. at EntityManager ->flush()
in ../src/Tools/TFIBundle/Model/CSVImport.php at line 136
7. at CSVImport ->addCategory ('fundusz obligacji')
in ../src/Tools/TFIBundle/Model/CSVImport.php at line 114
addCategory()方法如下:
public function addCategory($categoryName)
{
$category = new Category();
$category->setName($categoryName);
$this->em->persist($category);
$this->em->flush();
$this->counter['category']++;
return $category;
}
任何想法哪裏不對?或者如何在symfony2中獲得PDOException消息?
您確定您正在開發模式下運行嗎? – Cerad 2012-04-13 13:28:51
也許這條消息隱藏在你的html頁面源代碼中。 – greg0ire 2012-04-13 18:00:06