I need to fetch data from 2 tables. Actually just need to include one field from 2nd table into result of 1st table on basis of form key.
I did research and find a way to do this.
$qb->select(array('a', 'c'))
->from('Sdz\BlogBundle\Entity\Article', 'a')
->leftJoin('a.comments', 'c');
When i implemented it, it shows error Error: Class has no association named comments which is obvious thing because comments is not a field of Article table (entity). I am confused how to define 2nd table from which field needs to fetched, as a.comments is relates of Article table.