Form::Factory::Result::Gathered - A group of results
version 0.016
my $result = Form::Factory::Result::Gathered->new; $result->gather_results($other_result1, $other_result2, $other_result3); my @child_results = $result->results; $result->clear_messages; $result->clear_messages_for_field('foo'); $result->clear_results; $result->clear_all; my $validated = $result->is_validated; my $valid = $result->is_valid; my $has_outcome = $result->is_outcome_known; my $success = $result->is_success; my $messages = $result->messages; my $content = $result->content;
This is a collection of results. The results are grouped and collected together in a way that makes sense to the Form::Factory API.
my @results = $self->results;
Returns a list of the results that have been gathered.
$result->gather_results(@results);
Given one or more result objects, it adds them to the list of results already gathered. These are placed in a set such that no result is added more than once. If a result object was already added, it will not be added again.
Clears the state of all gathered results. It just calls clear_state recursively on all results.
clear_state
Clears the list of results. "results" will return an empty list after this is called.
Calls the clear_messages method on all results that have been gathered. This will clear messages for all the associated results.
clear_messages
$result->clear_messagesw_for_field($field);
Calls the clear_messages_for_field method on all results that have been gathered.
clear_messages_for_field
Clears all messages on the gathered results (via "clear_message") and then clears all the results (via "clear_results").
Tests each result for validity. This will return true if every result returns false for is_validated or returns true for is_valid.
is_validated
is_valid
Returns true if any result returns true for is_validated.
Tests each result for success. This will return true if every result returns false for is_outcome_known or true for is_success.
is_outcome_known
is_success
Returns true if any result returns true for is_outcome_known.
Returns a reference to an array of messages. This includes all messages from the gathered results.
Performs a shallow merge of all the return value of each result's content method and returns that.
content
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
<hanenkamp@cpan.org>
Copyright 2009 Qubling Software LLC.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
To install Form::Factory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Form::Factory
CPAN shell
perl -MCPAN -e shell install Form::Factory
For more information on module installation, please visit the detailed CPAN module installation guide.