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