Reputation: 899
I want to stop Doctrine from executing an update query if no changes made on the form.
Does anyone have any idea about that?
Upvotes: 1
Views: 196
Reputation: 899
It solved by using UnitOfWork outside of listeners like this code
$uow = $em->getUnitOfWork();
$uow->computeChangeSets();
$changeset = $uow->getEntityChangeSet($user);
if(!empty($changeset)) {
// my edit code here
}
Upvotes: 1