[Dbix-class] deleting many-to-many relationship entries in one
softdev at leandrohermida.com
Wed Jan 19 16:24:34 GMT 2011
On Wed, Jan 19, 2011 at 4:50 PM, Nigel Metheringham <
nigel.metheringham at dev.intechnology.co.uk> wrote:
> On 19 Jan 2011, at 15:33, Leandro Hermida wrote:
> > 1. Delete the bridging relationship
> > $person->person2address->delete;
> > I tried this but get Can't locate object method "person2address" via
> package "MySchema::Result::Person"? What did I set up wrong? In
> MySchema::Result::Person I have for the relationship:
Sorry I misspelled the relationship $person->person2address->delete works
> What version of DBIx::Class are you using?
> Whats happening here is $person->person2address is returning (a list of)
> row objects. I thought that this happened in array mode with scalar
> mode returning the RS for the query.
> In any case, if you want a RS, you can always use the _rs accessor,
This works too!
> will work without any ambiguity (and works in Template Toolkit if
> you are playing with objects within templates where the inherent
> array mode tends to break stuff).
> [ Nigel Metheringham Nigel.Metheringham at InTechnology.com ]
> [ - Comments in this message are my own and not ITO opinion/policy - ]
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the DBIx-Class