I am trying to combine the Doctrine Blameable and Softdeleteable extensions: when I execute $em->remove($myEntity);, I want to update the fields deletedand accordingly deletedBy.
use Gedmo\Mapping\Annotation as Gedmo;
[...]
private $deleted;
private $deletedBy;
I have a similar configuration for created / createdBy (with Blameable(on="create")) and updated / updated By (with Blameable(on="update")).
Even stranger, if I replaced the code above with the one below, the field deletedBywill be updated correctly:
/**
* Softdeleted by
* @var MyProject\UserBundle\Entity\User $deletedBy
*
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="MyProject\UserBundle\Entity\User")
* @ORM\JoinColumn()
*/
private $deletedBy;
So it seems that only the part is Blameable(on="change", field="deleted")not working, and I have no idea why ...
source
share