Hi Guilherme,
I did your mapping and and I renamed PK/FK of B and C, and edited mapField
of them too but now I get:
Column name `a_id` referenced for relation from Entity\A towards Entity\B
does not exist.
I guess you were wrong to define 'name' and 'referenceColumnName' ? I
changed them opposite (I think 'name' must be the entity where we are and
'referenceColumnName' is target entity, and not vice versa as you did? or I
am wrong?) anyway, I changed them the opposite way and I don't get the
error above anymore, but again I got index error as I said, so renaming
FK/PK of B and C did not help! I am grateful if you help further, at first
it would be good that please kindly test case it and confirm if this is not
a bug as the way you suggested did not solve the problem. Here are my new
mappings:
I am grateful for your advice. Thanks in advance.'
Entity A:
$metadata->mapOneToOne(array( 'fieldName' => 'b',
'targetEntity' => 'Entity\\B',
'mappedBy' => 'a',
'cascade' => array( 0 => 'remove', 1 => 'persist', ),
'joinColumns' => array( 0 => array( 'name'
=> 'a_id',
'referencedColumnName' => 'b_id',
'nullable' => true,
'onDelete' => 'cascade',
'columnDefinition' => NULL,
), )
));
$metadata->mapOneToOne(array( 'fieldName' => 'c',
'targetEntity' => 'Entity\\C',
'mappedBy' => 'a',
'cascade' => array( 0 => 'remove', 1 => 'persist', ),
'joinColumns' => array( 0 => array( 'name'
=> 'a_id',
'referencedColumnName' => 'c_id',
'nullable' => true,
'onDelete' => 'cascade',
'columnDefinition' => NULL,
), )
));
=======
Entity B:
$metadata->mapOneToOne(array( 'fieldName' => 'a',
'targetEntity' => 'Entity\\A',
'inversedBy' => 'b',
'joinColumns' => array( 0 => array( 'name'
=> 'b_id',
'referencedColumnName' => 'a_id',
'nullable' => true,
'columnDefinition' => NULL,
), )
));
=======
Entity C:
$metadata->mapOneToOne(array( 'fieldName' => 'a',
'targetEntity' => 'Entity\\A',
'inversedBy' => 'c',
'joinColumns' => array( 0 => array( 'name'
=> 'c_id',
'referencedColumnName' => 'a_id',
'nullable' => true,
'columnDefinition' => NULL,
), )
));
On Wed, Jul 8, 2015 at 11:34 AM, Nima Sadjadi <[email protected]> wrote:
> Hi Guilherme,
>
> I did not know what RTFM and IIRC mean as you used so I did STFW and GIYF
> to understand what they mean!!! :-))))
> From now on I will do STFW before asking! :-))))))
>
--
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/d/optout.