I have a custom table. I want to truncate the table using Magento collection without SQL query.
Hope someone will provide some useful information
I know it's a bit late but :
$tableName = $collection->getResource()->getMainTable();
$conn = $collection->getConnection();
$conn->truncateTable($tableName);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With