Thank you, but how can i get all needed objects with related ones?
I know i should not use "ID" in entities, this is just for testing. Even the query is simplified for testing. Miroslav Misek Dne pátek, 27. prosince 2013 0:01:51 UTC+1 Marco Pivetta napsal(a): > > Nothing wrong with that - you are just fetch-joining "ta.attributeID" > (don't name your association fields with "ID" in it!) as explained in > http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#joins > > Only one "ta" instance per identifier will appear in your resultset > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > > On 26 December 2013 23:52, <[email protected] <javascript:>> wrote: > >> Hi, >> >> I have DQL query: >> >> $query = $qb->select('ta', 'at') >> ->from('EveStatic\Entity\DgmTypeAttribute', 'ta') >> ->innerJoin('ta.attributeID', 'at') >> ->where('ta.typeID = :typeID') >> ->setParameter('typeID', $this->typeID) >> ->getQuery(); >> >> getSQL() returns: >> >> SELECT d0_.typeID AS typeID0, d0_.valueInt AS valueInt1, d0_.valueFloat AS >> valueFloat2, d1_.attributeID AS attributeID3, d1_.attributeName AS >> attributeName4, d1_.description AS description5, d1_.iconID AS iconID6, >> d1_.defaultValue AS defaultValue7, d1_.published AS published8, >> d1_.displayName AS displayName9, d1_.unitID AS unitID10, d1_.stackable AS >> stackable11, d1_.highIsGood AS highIsGood12, d0_.attributeID AS >> attributeID13, d1_.categoryID AS categoryID14 FROM dgmTypeAttributes d0_ >> INNER JOIN dgmAttributeTypes d1_ ON d0_.attributeID = d1_.attributeID WHERE >> d0_.typeID = ? >> >> >> Directly at mysql it returns 8 rows, but getResult() or getArrayResult() >> returns only first row with relations loaded. It should return 8 unique rows >> with relations loaded I think. >> >> >> Can anyone help me please and tell me, what I am doing wrong? >> >> >> Thanks, >> >> Miroslav Misek >> >> -- >> 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/groups/opt_out.
