I want to use where not In clause in doctrine
I did it like this:
$q->select('u.id')
->add('from', $from)
->Join('Entities\User','u','with','evt_vstr.user = u.id')
->where('evt_vstr.event = ?1')
->andwhere('u.designation= ?2')
->andwhere('u.id notIN (SELECT sender FROM Entities\Connect)')
ORTHIS ->andwhereNotIn('i.id',$connect_id)
->setParameter(1,$content['event_id'])
->setParameter(2,$content['designation'])
->setFirstResult($i)
->setMaxResults($max_result);
but its throw an error:
PHP Fatal error: Uncaught exception 'Doctrine\\ORM\\Query\\QueryException' with message 'SELECT u.id FROM Entities\\EventVisitor evt_vstr INNER JOIN Entities\\User u WITH evt_vstr.user = u.id WHERE evt_vstr.event = ?1 AND u.designation= ?2 AND u.id notIN ('SELECT sender FROM Entities\\Connect')'
and when I write this as follow
->andwhereNotIn('u.id', array(1,2,3,4,5)')
then it gives the following error
PHP Fatal error: Call to undefined method Doctrine\\ORM\\QueryBuilder::andwhereNotIn()
I read this here: doctrine how to write WhereIn() with another sql query inside
How can I do that ?