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