[Dbix-class] Multiple belongs_to relationships referencing same class

Tobias Kremer list at funkreich.de
Wed Apr 25 22:18:47 GMT 2007


Am 25.04.2007 um 23:10 schrieb Brandon Black:
> On 4/25/07, Tobias Kremer <list at funkreich.de> wrote:
>> Sounds like my kind of problem - what are the alternatives to proxy?
>
> One alternative to proxy is just to not use proxy.  Proxy is merely
> convenience.  Instead of saying $user_relation_object->username (which
> is ambiguous given your duplicate proxy statements), say
> $user_relation_object->requestor->username or
> $user_relation_object->receiver->username.

Yeah, but that's exactly what I want to avoid. If somebody does
$user->confirmed_friendships, he/she is not supposed to know who
initiated the friendship (requestor or receiver). All he/she wants
is a list of User objects (except $user) which are friends of $user.
The same goes for the other two methods. Currently I can't see a
sane way to accomplish this with DBIx::Class :(

--Tobias




More information about the Dbix-class mailing list