I am basically trying to execute dql as below:
$queryString = "SELECT ac FROM CloudExchange\Entities\Account ac JOIN ac.account_connections cn WHERE cn.account IN (:accounts)";
$query = $em->createQuery($queryString);
$query->setParameter('accounts', $service->getAccounts());
$results = $query->getResult();
I am using doctrine 2.3.x version. Seems like the above approach doesn't work. It returns following error:
PHP Catchable fatal error: Object of class Doctrine\ORM\PersistentCollection could not be converted to string in......
Can anyone have any idea what is possibly wrong with my approach or what alternative better way to achieve "WHERE IN" condition based DQL please? Thanks.