I have Entity (Invoice), which is intended solely for calculation purposes and does not have a table that links two other objects related by tables. (Although there are so many other parties involved).
class Row{ private $id; protected $file; private $date; } class File { private $id; private $name; } class Invoice { protected $id = null; protected $row; protected $file; }
I want to be able to request invoices:
$sDate = //Some date $this->getEntityManager() ->createQuery("SELECT Invoice, Row, File FROM ReportsEntitiesBundle:Invoice Invoice LEFT JOIN Row.row Row LEFT JOIN Row.file File WHERE date=:date" ) ->setParaMeter(':date', $sDate) ->setFirstResult($iPage*$iLimit) ->setMaxResults($iLimit) ->getResult();
Questions: # Doctrine is trying to execute a database query, how can I prevent this and find the appropriate objects? # How can I relate a date (which is in the Row entity and cannot be on the invoice) to the request?
Later this invoice will become part of another large facility for calculation / search.
thanks
source share