$qb->select('c')
->innerJoin('c.phones', 'p', 'WITH', 'p.phone = :phone')
->where('c.username = :username')
->setParameter('phone', $phone)
->setParameter('username', $username);
why do we use c.phones when we can just use innerJoin('phones', 'p', 'WITH', 'p.phone = :phone')?
phoneson its own may be ambiguous if more than one entity definesphonesproperty. Usingc.gives ORM exact information what user is expecting to happen.