[dev] Horde_Rdo: Many-to-many-relations between objects of the same type?

Ralf Lang lang at b1-systems.de
Mon Aug 22 18:57:35 UTC 2011


Am Montag, 22. August 2011, 18:23:11 schrieb Jan Schneider:
> Zitat von Ralf Lang <lang at b1-systems.de>:
> > Hi,
> > 
> > I wonder how I do many-to-many between objects of the same type/table in
> > horde_rdo.
> > 
> > $alice->allowsCall($bob);
> > array($alice) = $bob->mayCall();
> > 
> > Maybe it's a bad example as permissions could be handled by Horde_Perms
> > but the point is I fail finding a suitable setup of the relations array
> > to identify the two distinct participants in the 'through' table.
> > 
> > I could cheat myself out by making CallPermission an entity of its own
> > but I have no distinct data to tell about CallPermission other than who
> > allows and who is allowed.
> 
> Just a shot in the dark, but why does setting 'mapper' to "itself" not
> work? Or are you wondering about the 'though' table layout?

Probably I have done it wrong.

Obviously the two columns in the through-table have different names, but the 
key field for the mapping is the same on both sides.

I have built a "fake" mapper now for the through table and solved it as one-
to-many but it's probably only the second best solution.


-- 
Ralf Lang
Linux Consultant / Developer

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


More information about the dev mailing list