Unknown model· unknown
from ShareGPT 90K (shared ChatGPT conversations)
Please convert this postgres query to symfony doctrine query select \* from…
- User
Please convert this postgres query to symfony doctrine query
select * from account_profile ap where attributes_goal_key::jsonb @> '["RELATIONSHIP"]';
- Assistant
Assuming you have an entity named "AccountProfile" mapped to a table named "account_profile", the equivalent Symfony Doctrine query would be:
this->getDoctrine()->getManager();
em->getRepository(AccountProfile::class) ->createQueryBuilder('ap') ->where("ap.attributesGoalKey::jsonb @> :goal") ->setParameter('goal', '["RELATIONSHIP"]') ->getQuery() ->getResult();