[Dbix-class] cant delete resultset
Lee Standen
nom at standen.id.au
Thu Nov 2 06:40:08 GMT 2006
It's done with Voodoo Magic:
$schema->resultset('User')->find( username => $username )->delete();
Replace the resultset name and column name(s) with whatever you need.
Many systems tend to set users inactive, which is done with Witchcraft:
$schema->resultset('User')->find( username => $username
)->active(0)->update();
frank_coleman wrote:
> Sorry, that's exactly what I meant. I want to delete a single user.
>
>
>
>
>
> --- On Thu 11/02, Aran Deltac < aran at arandeltac.com > wrote:
>
> From: Aran Deltac [mailto: aran at arandeltac.com]
>
> To: dbix-class at lists.rawmode.org
>
> Date: Wed, 1 Nov 2006 21:39:37 -0800
>
> Subject: Re: [Dbix-class] cant delete resultset
>
>
>
> What you are deleting in your code example is a single user. If you want to delete an entire resultset then call delete on the resultset object:my $users = $schema->resultset('User');$users->delete;AranOn Wed, 1 Nov 2006 22:34:07 -0500 (EST), "frank_coleman" <frank_coleman at myway.com> wrote:> > Greetings!> > I am trying to delete a resultset, but it doesn't work.> > Tried to find the solution for days, but I'm lost.> > Here is my code:> > > > my $user = $schema->resultset('User')->find(1);> > $user->delete;> > > > -FC> > > > > > _______________________________________________> No banners. No pop-ups. No kidding.> Make My Way your home on the Web - http://www.myway.com> > > > _______________________________________________> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class> Wiki: http://dbix-class.shadowcatsystems.co.uk/> IRC: irc.perl.org#dbix-class> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/> Searchable Archive:>
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/_______________________________________________List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-classWiki: http://dbix-class.shadowcatsystems.co.uk/IRC: irc.perl.org#dbix-classSVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/Searchable Archive: http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
> _______________________________________________
> No banners. No pop-ups. No kidding.
> Make My Way your home on the Web - http://www.myway.com
>
>
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive: http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
More information about the Dbix-class
mailing list