How to do I stop one model from inserting if another model is failing?
I used this:
if ($robot->save() == false && $robot2->save == false) {
echo "Umh, We can store robots: ";
foreach ($robot->getMessages() as $message) {
echo message;
}
} else {
echo "Great, a new robot was saved successfully!";
}
But if one of the robots success, it will insert, but the other one wont insert.. How do i make them talk together?