I have two tables:
Posts
id | title | content | user
Users
id | name
and I want to have user name in Posts collection. What am I doing wrong here? Do I have to write custom query to do this?
Right now I'm getting user's id in posts collection.
class Posts
{
...
/**
* @ORMColumn(name="user", type="text", length=250)
* @ORMManyToOne(targetEntity="Users", inversedBy="posts")
* @ORMJoinColumn(name="user", referencedColumnName="id")
*/
protected $user;
...
