I'm trying to builder this data query
select *
from user
where user.id not in (
select user.id
from user
inner join repo_user
on user.id = repo_user.userId
where repo_user.repoId = $id
)
And I reference the answer 'where not in' query with doctrine query builder
My trying
class UserRepository extends EntityRepository
{
public function excludeUser($id)
{
$q1 = $this->createQueryBuilder('u')
->select('u.id')
->innerJoin('SvnAdminBundle:RepoUser', 'ru', 'WITH', "ru.userid = u.id")
->where("ru.repoid = $id")
->getQuery()
->getResult();
$qb = $this->createQueryBuilder('r');
$result = $qb->where($qb->expr()->notIn('r.id', $q1))
->getQuery()
->getResult();
return $result;
}
}
And I get the error message
Notice: Array to string conversion