Category: events

Symfony 4 when entity field change, change field in another entity

I have two entities for example: class Dog { /** * @var House * * @ORMManyToOne(targetEntity=”House”) * @ORMJoinColumns({ * @ORMJoinColumn(name=”house_id”, referencedColumnName=”id”) * }) */ private $house; } class House { /** * @var ArrayCollection|null * @ORMManyToMany(targetEntity=”Dog”,cascade={“persist”}) * @ORMJoinColumns({ * @ORMJoinColumn(name=”dog_id”,…