Skip to content

Loading…

DDC-51: Notice: Undefined index: [columnName] in/Doctrine/ORM/Mapping/OneToManyMapping.php on line 129 #5017

Closed
doctrinebot opened this Issue · 6 comments

1 participant

@doctrinebot

Jira issue originally created by user purnama:

With the same example as DDC-50

i now can not get the ManyToOne association (definitions, proverbs and relations);

i got php notice
Notice: Undefined index: phrase_id in /usr/local/zend/apache2/htdocs/doctrine/lib/Doctrine/ORM/Mapping/OneToManyMapping.php on line 129

if i check the line the variable $joinColumnValues is an empty array, because the PersistentCollection.php at line 233 did not send any joincolumnvalues to the load method. i dont know if this the cause.

i have try to set $entityManager->getConfiguration()->setAllowPartialObjects() to TRUE and make an dql like this
"SELECT p, d FROM ".models\Phrase::CLASS_NAME." p join p.definitions d WHERE p.phrase = '$phrase'"

but the result is still the same :(

@doctrinebot

Comment created by romanb:

Can you please show the code that you're using. I dont mean the models but the code that causes this problem.

Thanks.

@doctrinebot

Comment created by purnama:

$definitions = $phrase->getDefinitions();
var_dump($definitions[0] instanceof kateglo\application\models\Definition);

hope this help you.

regards,
arthur

@doctrinebot

Comment created by romanb:

Okay, thanks, I can reproduce this and will work on this. When I'm done I will add all these new tests to the test suite.

@doctrinebot

Comment created by romanb:

By the way, eager loading works fine for me. See this snippet:


        $query = $this->_em->createQuery("SELECT p,d FROM Doctrine\Tests\ORM\Functional\Phrase p JOIN p.definitions d");
        $res = $query->getResult();
        $definitions = $res[0]->getDefinitions();

        $this->assertEquals(1, count($res));
        $this->assertTrue($definitions[0] instanceof Definition);

This works for me. But lazy-loading results in the error you mentioned and which I will fix.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by purnama:

ok thank you very much it works like charm.

du bist Gold Wert Roman :)

please close the ticket.

Regards,
Arthur

@doctrinebot doctrinebot added this to the 2.0-ALPHA3 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.