Welcome Guest, Not a member yet? Register   Sign In
Skip forEmptyDataset Exception if there no changes on update
#1

Hi,
I'm getting lost in this simple task ... During an update, I need to ignore the "nothing changed" exception. 
Code:
throw DataException::forEmptyDataset($type);

I need to iterate a number of rows and update only if a specific condition is verified. So a lot of rows won't change, but a few of them need to be updated.
My script stops at the first DataException::forEmptyDataset($type).

Can I ignore it during the update?
Something like: If something has changed then update the row otherwise continue.

Thanks
Reply
#2

Catch the exception.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB