public function preRemove(LifecycleEventArgs $eventArgs)
    {
        $em = $eventArgs->getEntityManager();
        $uow = $em->getUnitOfWork();
        $entity = $eventArgs->getEntity();

        $classMetadata = $em->getClassMetadata(get_class($entity));
        if ($this->isBlameable($classMetadata)) {
            if (!$entity->isBlameable()) {
                return;
            }
            $user = $this->getUser();
            if ($this->isValidUser($user)) {
                $oldValue = $entity->getDeletedBy();
                $entity->setDeletedBy($user);
                $uow->propertyChanged($entity, 'deletedBy', $oldValue, $user);

                $uow->scheduleExtraUpdate($entity, [
                    'deletedBy' => [$oldValue, $user],
                ]);
            }
        }
    }
public function preRemove(LifecycleEventArgs $eventArgs)
    {
        $em = $eventArgs->getEntityManager();
        $uow = $em->getUnitOfWork();
        $entity = $eventArgs->getEntity();

        $classMetadata = $em->getClassMetadata(get_class($entity));
        if ($this->isBlameable($classMetadata)) {
            if (!$entity->isBlameable()) {
                return;
            }
            $user = $this->getUser();
            if ($this->isValidUser($user)) {
                $oldValue = $entity->getDeletedBy();
                $entity->setDeletedBy($user);
                $uow->propertyChanged($entity, 'deletedBy', $oldValue, $user);

                $uow->scheduleExtraUpdate($entity, [
                    'deletedBy' => [$oldValue, $user],
                ]);
            }
        }
    }
public function preRemove ( LifecycleEventArgs $ eventArgs ) { $ em = $ eventArgs -> getEntityManager ( ) ; $ uow = $ em -> getUnitOfWork ( ) ; $ entity = $ eventArgs -> getEntity ( ) ; $ classMetadata = $ em -> getClassMetadata ( get_class ( $ entity ) ) ; if ( $ this -> isBlameable ( $ classMetadata ) ) { if ( ! $ entity -> isBlameable ( ) ) { return ; } $ user = $ this -> getUser ( ) ; if ( $ this -> isValidUser ( $ user ) ) { $ oldValue = $ entity -> getDeletedBy ( ) ; $ entity -> setDeletedBy ( $ user ) ; $ uow -> propertyChanged ( $ entity , 'deletedBy' , $ oldValue , $ user ) ; $ uow -> scheduleExtraUpdate ( $ entity , [ 'deletedBy' => [ $ oldValue , $ user ] , ] ) ; } } }
Stores the current user into deletedBy property

@param LifecycleEventArgs $eventArgs
Stores the current user into deletedBy property