initial commit with working tests, docs, and conversion to dzil+podweaver
[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 is: ro, isa ArrayRef[Tuple[Object,Maybe[HashRef]]], traits: ['Array']
11
12 This attribute stores the objects found/created at the object action. It handles the following methods:
13
14     all_objects => 'elements'
15     add_object => 'push'
16     count_objects => 'count'
17     has_objects => 'count'
18     clear_objects => 'clear'
19
20 =cut
21
22 has objects =>
23 (
24     is => 'ro',
25     isa => ArrayRef[ Tuple[ Object, Maybe[HashRef] ] ],
26     traits => [ 'Array' ],
27     default => sub { [] },
28     handles => 
29     {
30         all_objects => 'elements',
31         add_object => 'push',
32         count_objects => 'count',
33         has_objects => 'count',
34         clear_objects => 'clear',
35     },
36 );
37
38 =attribute_public current_result_set is: ro, isa: L<Catalyst::Controller::DBIC::API::Types/ResultSet>
39
40 Stores the current ResultSet derived from the initial L<Catalyst::Controller::DBIC::API::StoredResultSource/stored_model>.
41
42 =cut
43
44 has current_result_set =>
45 (
46     is => 'ro',
47     isa =>  ResultSet,
48     writer => '_set_current_result_set',
49 );
50
51 1;