perltidy all classes
[catagits/Catalyst-Controller-DBIC-API.git] / lib / Catalyst / Controller / DBIC / API / Request / Context.pm
CommitLineData
d2739840 1package Catalyst::Controller::DBIC::API::Request::Context;
2
3#ABSTRACT: Provides additional context to the Request
4use Moose::Role;
5use MooseX::Types::Moose(':all');
6use MooseX::Types::Structured('Tuple');
7use Catalyst::Controller::DBIC::API::Types(':all');
8use namespace::autoclean;
9
8ea592cb 10=attribute_public objects is:
11 ro
12 isa ArrayRef[Tuple[Object,Maybe[HashRef]]]
13 traits: ['Array']
d2739840 14
8ea592cb 15This attribute stores the objects found/created at the object action.
16It handles the following methods:
d2739840 17
8ea592cb 18 all_objects => 'elements'
19 add_object => 'push'
d2739840 20 count_objects => 'count'
8ea592cb 21 has_objects => 'count'
d2739840 22 clear_objects => 'clear'
23
24=cut
25
8ea592cb 26has objects => (
27 is => 'ro',
28 isa => ArrayRef[Tuple[Object,Maybe[HashRef]]],
29 traits => ['Array'],
d2739840 30 default => sub { [] },
8ea592cb 31 handles => {
32 all_objects => 'elements',
33 add_object => 'push',
d2739840 34 count_objects => 'count',
8ea592cb 35 has_objects => 'count',
d2739840 36 clear_objects => 'clear',
8ea592cb 37 get_object => 'get',
d2739840 38 },
39);
40
8ea592cb 41=attribute_public current_result_set is:
42 ro
43 isa: L<Catalyst::Controller::DBIC::API::Types/ResultSet>
d2739840 44
8ea592cb 45Stores the current ResultSet derived from the initial
46L<Catalyst::Controller::DBIC::API::StoredResultSource/stored_model>.
d2739840 47
48=cut
49
8ea592cb 50has current_result_set => (
51 is => 'ro',
52 isa => ResultSet,
d2739840 53 writer => '_set_current_result_set',
54);
55
561;