Using Doctrine 2 I want to get some users that are contacts of another user. The table user contains the mapping between those users. The query in the function
user
Don't surround any of the parameters in your query text with quotes!
->add('where', "c.owner = ?1 AND c.contact = u.id AND u.username LIKE '?2'")
should be
->add('where', "c.owner = ?1 AND c.contact = u.id AND u.username LIKE ?2")