[Dbix-class] RecursiveUpdate and many to many

Matt S Trout dbix-class at trout.me.uk
Sun Sep 28 14:44:17 BST 2008


On Sat, Sep 27, 2008 at 09:19:06PM +0200, Zbigniew Lukasiak wrote:
> On Sat, Sep 27, 2008 at 8:59 PM, Matt S Trout <dbix-class at trout.me.uk> wrote:
> > On Sat, Sep 27, 2008 at 09:54:44AM +0200, Zbigniew Lukasiak wrote:
> >> Hi Matt,
> >>
> >> I would like to include your critisizm of the support for many to many
> >> in RecursiveUpdate in it's documentation.  Tell me if I get it right.
> >> What I remember is two points:
> >>
> >> 1. That I rely on the fact that
> >>
> >> if($object->can($name) and
> >>             !$object->result_source->has_relationship($name) and
> >>             $object->can( 'set_' . $name )
> >>         )
> >>
> >> then $name must be a many to many pseudo relation.  And that in a
> >> similarly ugly was I find out what is the ResultSource of objects from
> >> that many to many pseudo relation.
> >>
> >> 2. That I treat uniformly relations and many to many (which are
> >> different from relations because they require traversal of the bridge
> >> table).
> >>
> >> Is that right?
> >
> > Precisely, which means your code is fragile and implicitly broken.
> >
> 
> Just to focus the discussion - you are referring here to 1) or 2)?

Both.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list