Each invoice may have several items I did set ManyToOne from invoiceitem to
invoice as below:
$metadata->mapManyToOne(array( 'fieldName' => 'invoices',
'targetEntity' => 'Entities\\Invoice',
'inversedBy' => 'invoices',
'joinColumns' => array( 0 => array( 'name'
=> 'invoice_id',
'referencedColumnName' => 'id',
'nullable' => true,
'columnDefinition' => NULL,
), )
));
==
OneToMany from invoice to invoiceitems as below:
$metadata->mapOneToMany(array( 'fieldName' => 'invoiceItems',
'targetEntity' => 'Entities\\InvoiceItem',
'mappedBy' => 'invoiceItems',
'joinColumns' => array( 0 => array( 'name'
=> 'id',
'referencedColumnName' => 'invoice_id',
'nullable' => true,
'columnDefinition' => NULL,
), )
));
==
When I run query from ManyToOne as below it works fine:
"FROM Entities\InvoiceItem t JOIN t.invoices i"
But when from OneToMany as below I get SQL error and when I echo SQLLOgger
I see "INNER JOIN" is blank. what wrong I did?
"FROM Entities\Invoice i JOIN i.invoiceItems t"
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.