Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Pecha janpecha

View GitHub Profile
View gist:bc9566e95f21ad7b2ef0
<?php
// $foo = Mage::getModel('.....
// $bar = Mage::getModel('.....
$transaction = Mage::getModel('core/resource_transaction');
$transaction->addObject($foo);
$transaction->addObject($bar);
$transaction->save(); // runs save on all objects. On error -> rollback
You can’t perform that action at this time.