Can I use prePersist/preUpdate in Sonata Admin controller to persist more than one object?
问题 I have this Alias entity: use Gedmo\Timestampable\Traits\TimestampableEntity; class Alias { use IdentifierAutogeneratedTrait; use TimestampableEntity; use ActiveTrait; /** * @var string * @ORM\Column(type="string", length=150) */ private $name; /** * Command associated to the alias. * * @var Command[] * @ORM\ManyToMany(targetEntity="Command", mappedBy="aliases", cascade={"persist"}) */ private $commands; ... } And I have this Admin controller: class AliasAdmin extends Admin { protected