/** * @param UnitOfWork $uow * @param EntityManager $em * @param $entity * @param $action */ protected function log(UnitOfWork $uow, EntityManager $em, $entity, $action) { $logEntity = new LogEntity($this->getUser(), get_class($entity), $entity->id, $action); $entity->log($logEntity, $uow, $action); $uow->persist($logEntity); $uow->computeChangeSet($em->getClassmetadata(get_class($logEntity)), $logEntity); }