Doctrine


How To Truncate A Table With Doctrine 1

Doctrine ORM does not provide a built in method to truncate a table, so we must run a sql query manually. Use the below code and alter the SQL as needed:

$doctrine = Doctrine_Manager::getInstance()->getCurrentConnection()->getDbh();
$doctrine->query('TRUNCATE TABLE tableName');
unset($doctrine);