For a game I have 2 entities: story and story_completed. Story is same for all users(here company), and story_completed indicates which user have seen/completed which story. Now I would like to show a list of stories for an user and show which are completed and which are not completed.
So, I created 2 entities:
...
table: story
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
name:
type: string
AND
...
table: story_completed
id:
id:
type: integer
generator: { strategy: AUTO }
ManyToOne:
story:
targetEntity: Story
fields:
company_id:
type: integer
But now, if I do a JOIN
SELECT s FROM Story s LEFT JOIN s.completed c WHERE ...
I get an error: Error: Class ...\Story has no association named completed.
Maybe I misunderstood the manyToOne association, but how can I do this simple 2 tables connection and join in doctrine2? In fact I need only to know for a story if a user X have completed it or not. I don't need a collection or bidirectional connection.