I have some query and I need in select block select id relation entity, how can I do it without some join, like in SQL? In example I add leftJoin but I want understand it's possible without join like lsc.serviceCompany.id
or how ?
$qb
->select('
ser_com.id as serviceCompanyId
')
->from('AppBundle:LocationServiceCompany', 'lsc')
->leftJoin('lsc.serviceCompany', 'ser_com')
->where('lsc.serviceCompany = :sc')
->setParameter('sc', $serviceCompany);