Function to easily get attributes of relations


I have a Users and Skills related by a MANY_MANY relation. The quality of the skill (e.g. speaking a language very well or just a little) is defined by an attribute of the relationship.


> User: id, name

> Skill: Id, title

> UserSkillRel: id, user_id, skill_id, quality

As far as I understand the AR-Classes it’s almost impossible to easily access relationship attributes.

That’s why Im asking for a simple method to read attributes of the relationship.

what is an "attribute of the relationship" ?

Please check the table structure above.

> UserSkillRel: id, user_id, skill_id, quality

An attribute adds a property to a relationship as described above.

The words you use have no unambiguous or common definition. Provide the code or use generic terms if you want to be understod, please.

Sorry that I am not an english native speaker. For me "attribute of a relationship" is quite clear though.

Anyway, here is the description of the feature I would like to see:

"I want to easily add and read additional joinfields of a relationship-table."

Another thread describing the feature is here:

Mike described a solution but for me it feels a little complicated if it could be more straight forward (see the DataMapper-Feature).