+1 Em terça-feira, 12 de novembro de 2013 19h23min13s UTC-2, Marco Pivetta escreveu: > > That basically confirms that it's not to be fixed in the ProxyFactory. > > Can you provide the mappings for what is causing the issue? If we can > build a failing test case around that then we can proceed and decide what > to do with that. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > > On 12 November 2013 22:16, <[email protected] <javascript:>> wrote: > >> Thanks for your answer Marco. I absolutely agree with you regarding the >> notice. :) >> >> $identifier contains an array with just the primary key field, the >> nullable foreign key part is absent. >> >> I could fix the code by adding a simple array_key_exists test like this: >> foreach ($definition->identifierFields as $idField) { >> if (array_key_exists($idField, $identifier)) { >> >> $definition->reflectionFields[$idField]->setValue($proxy, >> $identifier[$idField]); >> } >> } >> But I don't know if there are consequences elsewhere... >> >> Another observation : even when the foreign key is null in the database, >> the association object exists if I do a $entity->getFoo() call, but is >> incorrect because the generated SQL request does not include the foreign >> key part in the where clause! So it does : >> select * from Provider where CouncilId = 'xx' >> instead of >> select * from Provider where CouncilId = 'xx' and ProviderId = 'yy' >> The expected result for $entity->getFoo() would be NULL in case of >> ProviderId is null. >> >> So even with my "fix",the problem's still there. >> >> Any idea to solve this tricky situation ? >> Thanks. >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/doctrine-user. >> For more options, visit https://groups.google.com/groups/opt_out. >> > >
-- 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.
