First: apologies from my side too if I misunderstood you. I'm a bit in a hurry, so maybe I give an answer too quickly sometimes. I just want to give some first aid for your modeling.
On Friday, 14 February 2014 09:20:25 UTC+1, Parsifal wrote: > > Is it normal to get this array? I tought I should get an array > structure like the first one but just with optVar1 in it? > This is normal or I did a mistake? > This is normal: you are querying the objects, not the tables. In the first case you queried: give me those Rem-entities and eager-load their related Info-entities. In the second case you queried: give me those Rem-entities (but don't eager load their related Info entities) and give me the fields optVar1 from their related Info-entities. OptVar1 is just some value, in this case the value of a field, but in itself not an object, so it doesn't have a relation like Info has to Rem. On Friday, 14 February 2014 09:20:25 UTC+1, Parsifal wrote: > P.S. I appreciate plural/singular and caps letter correction too, if > there is any yet! > I personally let the field-name start with a lowercase character and a plural entity, like the collection of Rem-entities in Info, are handy to put in plural. so: 'fieldName' => info' and 'fieldName' => 'rems'. I also don't immediately see what 'Rem' and 'rems' mean, so I'd prefer a more informative name. On Friday, 14 February 2014 09:20:25 UTC+1, Parsifal wrote: > 2) Also if I use getResult instead of getArrayResult, I get this error: > (...) > Ah yeah, didn't look very deep in it, but it looks like you are retrieving some non-related non-objects (see above) and trying to output them as objects. If you try to retrieve non-objects from your database, then what is the use of an ORM? For that is to map the entities (= objects) from your domain model to the tables in the relational database. If you just want to retrieve values from tables, without using objects, you don't need Doctrine... -- 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.
