- CLASS METHODS
- SEE ALSO
- COPYRIGHT & LICENSE
DBIx::Class::Valiant::Result - Base component to add Valiant functionality
package Example::Schema::Result::Person; use base 'DBIx::Class::Core'; __PACKAGE__->load_components('Valiant::Result');
Or just add to your base Result class
package Example::Schema::Result; use strict; use warnings; use base 'DBIx::Class::Core'; __PACKAGE__->load_components('Valiant::Result');
When doing an insert / create on a result, we automatically add a 'create' context which you can use to limit validations to create events. Additionally for an update we add an 'update' context.
This component adds the following class or package methods to your result classes. Please note this is only class methods added by this package, it does not cover those which are aggregated from the Valiant::Validates role.
Defaults to true. When true Valiant will first perform a validation on the existing result object (and any related objects nested under it which have been loaded from the DB or created) and if there are validation errors will skip persisting the data to the database. You can use this to disable this behavior globally. Please not there are features to enable skipping auto validation on a per result/set basis as well.
Allows you to update / create related objected which are nested under the parent (via has_one, might_have or has_many defined relationships).
This component adds the following object methods. Please note this is only class methods added by this package, it does not cover those which are aggregated from the Valiant::Validates role.
Will be true if the result has been marked for deletion. You might see this in a related result nested under a parent when an update calls for the record to be deleted but validation errors prevented the deletion from occuring.
John Napiorkowski email:email@example.com
Copyright 2020, John Napiorkowski email:firstname.lastname@example.org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.