GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Class::DBI::Cascade::None(3) User Contributed Perl Documentation Class::DBI::Cascade::None(3)

Class::DBI::Cascade::None - Do nothing upon deletion

This is a Cascading Delete strategy that will do nothing, leaving orphaned records behind.

It is the base class for most ofther Cascade strategies, and so provides several important methods:

        my $strategy = Cascade::Class->new($Relationship);

This must be instantiated with a Class::DBI::Relationship object.

        my $iterator = $strategy->foreign_for($obj);

This will return all the objects which are foreign to $obj across the relationship. It's a normal Class::DBI search you can get the results either as a list or as an iterator.

        $strategy->cascade($obj);

Cascade across the related objects to $obj.

Creating a Cascade strategy should be fairly simple. You usually just need to inherit from here, and then supply a cascade() method that does the required thing with the results from foreign_for().

So, for example, Cascade::Delete is implemented simply as:

        package Class::DBI::Cascade::Delete;

        use base 'Class::DBI::Cascade::None';

        sub cascade {
                my ($self, $obj) = @_;
                $self->foreign_for($obj)->delete_all;
        }
2005-09-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.