[Dbix-class] Listing of many_to_many relations (ResultSet reflection)

Zbigniew Lukasiak zzbbyy at gmail.com
Tue Jan 30 16:16:30 GMT 2007


Hi,

Currently the ResultSet reflection (using the relationships method) is
constrained to the 'true' relationships (that is those involving just
two database tables) and there is no way to find the many_to_many
relationships of a given ResultSet.

I can imagine only two solutions to this:

1. List the many_to_many relations with the relationships method.

2. Add a many_to_many_relationships method.

The disadvantages of 1. are
- no backward compatibility (I don't know how serious this is)
- the many_to_many relationships are represented internally in a
different way - so they might be more constrained then the 'real'
relationships and listing them in the same place might be confusing
(on the other hand it might be possible to make them working exactly
like the other relations and just forget about the low level
implementation details)

The advantage is that don't add another method.

What do you think?  Is there any other way?

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/



More information about the Dbix-class mailing list