Ok, then it looks that localAlias doesn't exist, sry for that :) So make it ' foreignAlias Ristorantes '
And you can use method on Ristorante object ->getZoneCita() (gives you 1 ZoneCita object) And on ZoneCita object use ->getRistorantes() (this name is taken from the foreignAlias specification) On 23 dub, 11:35, SatBoy78 <bruno.mat...@gmail.com> wrote: > Hi, thanks a lot for your suggestions... in fact I need a 1:N relation > I've tried to use your hints, but when I make a build --all I've got > an error: symfony can't recognize localAlias > I've searched localAlias on symfony documentation, but I can't find it > > What's wrong? > > thanks > > On 23 Apr, 09:29, Tom Ptacnik <to...@tomor.cz> wrote: > > > > > > > I see your schema and there is a relation 1:N, but I think badly > > specified - i think it should be - Ristorante has 1 ZoneCitta, > > ZonneCitta has N Ristorantes > > if so then you have to specify the relation under the Ristorante > > Ristorante: > > ... > > relations: > > ZoneCitta: > > local: zona > > foreign: id > > localAlias: ZonaCitta > > > Then if you do on the Ristorante object getZonaCita() you should get > > one ZoneCitta (see in the schema I've changed to the capital Z -> / > > foreignAlias: zonaCitta/ to /localAlias: ZonaCitta/ > > Now you have __toString() method in the ZoneCitta object and it should > > show this string field. > > > Your getZonaCitta() in the ZoneCitta class is nonsense. > > > I think the problem was in the schema - badly specified the 1:N > > relation. > > > If you need to have M:N relation you should read some manuals and > > correct the schema for it.. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en