I\'ve got an InvoiceItem entity like this:
/** * @Entity */ class InvoiceItem { [..] /** * @ManyToOne(targetEntity=\"Invoice\", inversedBy=\"item
You can use the setHint() method to make the foreign key get returned with the rest of the values for your entity. You apply the method to the query (not the querybuilder):
$q = $qb->getQuery(); $q->setHint(\Doctrine\ORM\Query::HINT_INCLUDE_META_COLUMNS, true);