How to check if entity changed in Doctrine 2?

前端 未结 9 724
盖世英雄少女心
盖世英雄少女心 2020-12-23 20:53

I need to check if a persisted entity has changed and needs to be updated on the database. What I made (and did not work) was the following:

$product = $enti         


        
9条回答
  •  一整个雨季
    2020-12-23 21:17

    If you only need to compare old and new state of object then probably this would be simpler:

    $originalEntityData = $entityManager->getUnitOfWork()->getOriginalEntityData($entityObject);
    

提交回复
热议问题