Merge in object_split functionality
[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
10=attribute_public objects is: ro, isa ArrayRef[Tuple[Object,Maybe[HashRef]]], traits: ['Array']
11
12This 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
22has 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',
609916e5 35 get_object => 'get',
d2739840 36 },
37);
38
39=attribute_public current_result_set is: ro, isa: L<Catalyst::Controller::DBIC::API::Types/ResultSet>
40
41Stores the current ResultSet derived from the initial L<Catalyst::Controller::DBIC::API::StoredResultSource/stored_model>.
42
43=cut
44
45has current_result_set =>
46(
47 is => 'ro',
48 isa => ResultSet,
49 writer => '_set_current_result_set',
50);
51
521;