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
Interchange6::Schema::Component::Validation(3) User Contributed Perl Documentation Interchange6::Schema::Component::Validation(3)

Interchange6::Schema::Component::Validation

  package My::Result;

  __PACKAGE__->load_components(qw(
    +Interchange6::Schema::Component::Validation
  ));

  sub validate {
    my $self = shift;
    my $schema = $self->result_source->schema;

    unless ( $self->some_column =~ /magic/ ) {
      $schema->throw_exception("some_column does not contain magic");
    }
  }

This component allows validation of row attributes to be deferred until other components in the stack have been called. For example you might want to have the TimeStamp component called before validation so that datetime columns with set_on_create are defined before validation occurs. In this case your local_components call might look like;

__PACKAGE__->load_components( qw(TimeStamp +Interchange6::Schema::Component::Validation) );

In order to fail validation the "validation" method must throw an exception.

Called before insert or update action. Method should be overloaded by class which load this component. Validation failures should result in DBIx::Class::Schema::throw_exception being called.

Overload insert to call "validate" before insert is performed.

Overload update to call "validate" before update is performed.
2014-04-15 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.