querycounter role, test for that and a new schema hierarchy for additional Moose...
[dbsrgits/DBIx-Class.git] / t / lib / DBICNGTest / Schema / ResultSet / Person.pm
CommitLineData
62fa8aec 1package # hide from pause
2 DBICNGTest::Schema::ResultSet::Person;
3
4 use Moose;
5 extends 'DBICNGTest::Schema::ResultSet';
6
7
8=head1 NAME
9
10DBICNGTest::Schema::ResultSet:Person; Example Resultset
11
12=head1 VERSION
13
140.01
15
16=cut
17
18our $VERSION = '0.01';
19
20
21=head1 SYNOPSIS
22
23 ##Example Usage
24
25See Tests for more example usage.
26
27=head1 DESCRIPTION
28
29Resultset Methods for the Person Source
30
31=head1 ATTRIBUTES
32
33This class defines the following attributes.
34
35=head2 literal
36
37a literal attribute for testing
38
39=cut
40
41has 'literal' => (is=>'ro', isa=>'Str', required=>1, lazy=>1, default=>'hi');
42
43
44=head2 available_genders
45
46A resultset of the genders people can have. Keep in mind this get's run once
47only at the first compile, so it's only good for stuff that doesn't change
48between reboots.
49
50=cut
51
52has 'available_genders' => (
53 is=>'ro',
54 isa=>'DBICNGTest::Schema::ResultSet',
55 required=>1,
56 lazy=>1,
57 default=> sub {
58 shift
59 ->result_source
60 ->schema
61 ->resultset('Gender');
62 }
63);
64
65
66=head1 METHODS
67
68This module defines the following methods.
69
70=head2 older_than($int)
71
72Only people over a given age
73
74=cut
75
76sub older_than
77{
78 my ($self, $age) = @_;
79
80 return $self->search({age=>{'>'=>$age}});
81}
82
83
84=head1 AUTHORS
85
86See L<DBIx::Class> for more information regarding authors.
87
88=head1 LICENSE
89
90You may distribute this code under the same terms as Perl itself.
91
92=cut
93
94
951;