1 package Catalyst::Controller::DBIC::API::Types;
3 #ABSTRACT: Provides shortcut types and coercions for DBIC::API
7 use MooseX::Types -declare => [qw/OrderedBy GroupedBy Prefetch SelectColumns AsAliases ResultSource ResultSet Model SearchParameters JoinBuilder/];
8 use MooseX::Types::Moose(':all');
10 =type Prefetch as Maybe[ArrayRef[Str|HashRef]]
12 Represents the structure of the prefetch argument.
14 Coerces Str and HashRef.
18 subtype Prefetch, as Maybe[ArrayRef[Str|HashRef]];
19 coerce Prefetch, from Str, via { [$_] }, from HashRef, via { [$_] };
21 =type GroupedBy as Maybe[ArrayRef[Str]]
23 Represents the structure of the grouped_by argument.
29 subtype GroupedBy, as Maybe[ArrayRef[Str]];
30 coerce GroupedBy, from Str, via { [$_] };
32 =type OrderedBy as Maybe[ArrayRef[Str|HashRef|ScalarRef]]
34 Represents the structure of the ordered_by argument
40 subtype OrderedBy, as Maybe[ArrayRef[Str|HashRef|ScalarRef]];
41 coerce OrderedBy, from Str, via { [$_] }, from HashRef, via { [$_] };
43 =type SelectColumns as Maybe[ArrayRef[Str|HashRef]]
45 Represents the structure of the select argument
51 subtype SelectColumns, as Maybe[ArrayRef[Str|HashRef]];
52 coerce SelectColumns, from Str, via { [$_] }, from HashRef, via { [$_] };
54 =type SearchParameters as Maybe[ArrayRef[HashRef]]
56 Represents the structure of the search argument
62 subtype SearchParameters, as Maybe[ArrayRef[HashRef]];
63 coerce SearchParameters, from HashRef, via { [$_] };
65 =type AsAliases as Maybe[ArrayRef[Str]]
67 Represents the structure of the as argument
71 subtype AsAliases, as Maybe[ArrayRef[Str]];
73 =type ResultSet as class_type('DBIx::Class::ResultSet')
75 Shortcut for DBIx::Class::ResultSet
79 subtype ResultSet, as class_type('DBIx::Class::ResultSet');
81 =type ResultSource as class_type('DBIx::Class::ResultSource')
83 Shortcut for DBIx::Class::ResultSource
87 subtype ResultSource, as class_type('DBIx::Class::ResultSource');
89 =type JoinBuilder as class_type('Catalyst::Controller::DBIC::API::JoinBuilder')
91 Shortcut for Catalyst::Controller::DBIC::API::JoinBuilder
95 subtype JoinBuilder, as class_type('Catalyst::Controller::DBIC::API::JoinBuilder');
97 =type Model as class_type('DBIx::Class')
99 Shortcut for model objects
103 subtype Model, as class_type('DBIx::Class');