Chloro::Result::Group - A result for a single group
version 0.07
my $group_result = $resultset->result_for('group'); for my $field_result ( $group_result->results() ) { print $field_result->field()->name() . ' = ' . $field_result->value(); }
This class represents the result for a single repetition of a group after processing user-submitted data.
A group result is like a miniature Chloro::ResultSet object, and shares some methods with that class, because it contains the results for more than one field.
This class has the following methods:
The constructor accepts the following arguments:
group
The Chloro::Group object for this result.
key
The key associated with this group. This is a single value from the values in the associated Chloro::Group object's repetition_key field.
repetition_key
prefix
The prefix for each field in this group. This will be the group name and key separated by a period ("."), something like "phone_number.42".
results
This should be a hash reference where the keys are field names and the values are Chloro::Result::Field objects.
Returns a list of Chloro::Result::Field objects for the fields associated with this repetition of the group.
Given a field name, returns the Chloro::Result::Field object for that field. Note that for this API, you can simply pass the field's name without a group prefix.
Returns the key associated with this group result.
Returns the field prefix for this group result.
This returns true if none of the fields in this group's result have any errors.
Returns the result as a key/value pair, where the keys are field names (without prefixes).
This class does the Chloro::Role::Result and Chloro::Role::ResultSet role.
Bugs may be submitted at http://rt.cpan.org/Public/Dist/Display.html?Name=Chloro or via email to bug-chloro@rt.cpan.org.
I am also usually active on IRC as 'autarch' on irc://irc.perl.org.
irc://irc.perl.org
The source code repository for Chloro can be found at https://github.com/autarch/Chloro.
Dave Rolsky <autarch@urth.org>
This software is Copyright (c) 2017 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
The full text of the license can be found in the LICENSE file included with this distribution.
To install Chloro, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chloro
CPAN shell
perl -MCPAN -e shell install Chloro
For more information on module installation, please visit the detailed CPAN module installation guide.