I have two entities with a many-to-many association:
class User extends BaseUser
and
class Calendar { /** * @var integ
You should add addPublisher(User $publisher) and removePublisher(User $publisher) methods.
addPublisher(User $publisher)
removePublisher(User $publisher)
API Platform internally uses the Symfony PropertyAccess component, and this component requires such methods to be able to access to the private property.