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.
API Platform internally uses the Symfony PropertyAccess component, and this component requires such methods to be able to access to the private property.
It sounds like you should specify fetch="EAGER"
in the relationship so that it always gets the related objects.
see http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#manytoone (and also the next paragraph)
and some good info here: http://www.uvd.co.uk/blog/some-doctrine-2-best-practices/