line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## no critic (Moose::RequireMakeImmutable) |
2
|
|
|
|
|
|
|
package Fey::ORM::Schema; |
3
|
|
|
|
|
|
|
|
4
|
9
|
|
|
9
|
|
13699214
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
324
|
|
5
|
9
|
|
|
9
|
|
50
|
use warnings; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
302
|
|
6
|
9
|
|
|
9
|
|
48
|
use namespace::autoclean; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
93
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.47'; |
9
|
|
|
|
|
|
|
|
10
|
9
|
|
|
9
|
|
3317
|
use Fey::Meta::Class::Schema; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
506
|
|
11
|
9
|
|
|
9
|
|
5089
|
use Fey::Object::Schema; |
|
9
|
|
|
|
|
35
|
|
|
9
|
|
|
|
|
449
|
|
12
|
|
|
|
|
|
|
|
13
|
9
|
|
|
9
|
|
89
|
use Moose 1.15 (); |
|
9
|
|
|
|
|
270
|
|
|
9
|
|
|
|
|
308
|
|
14
|
9
|
|
|
9
|
|
66
|
use MooseX::StrictConstructor 0.13 (); |
|
9
|
|
|
|
|
190
|
|
|
9
|
|
|
|
|
227
|
|
15
|
9
|
|
|
9
|
|
52
|
use Moose::Exporter; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
67
|
|
16
|
9
|
|
|
9
|
|
497
|
use MooseX::Params::Validate qw( pos_validated_list ); |
|
9
|
|
|
|
|
237
|
|
|
9
|
|
|
|
|
98
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Moose::Exporter->setup_import_methods( |
19
|
|
|
|
|
|
|
with_meta => [qw( has_schema )], |
20
|
|
|
|
|
|
|
also => [ 'Moose', 'MooseX::StrictConstructor' ], |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub init_meta { |
24
|
11
|
|
|
11
|
0
|
29034
|
shift; |
25
|
11
|
|
|
|
|
65
|
my %p = @_; |
26
|
|
|
|
|
|
|
|
27
|
11
|
|
|
|
|
81
|
return Moose->init_meta( |
28
|
|
|
|
|
|
|
%p, |
29
|
|
|
|
|
|
|
base_class => 'Fey::Object::Schema', |
30
|
|
|
|
|
|
|
metaclass => 'Fey::Meta::Class::Schema', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub has_schema { |
35
|
11
|
|
|
11
|
1
|
297940
|
my $meta = shift; |
36
|
|
|
|
|
|
|
|
37
|
11
|
|
|
|
|
95
|
my ($schema) = pos_validated_list( \@_, { isa => 'Fey::Schema' } ); |
38
|
|
|
|
|
|
|
|
39
|
11
|
|
|
|
|
4119
|
$meta->_associate_schema($schema); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# ABSTRACT: Provides sugar for schema-based classes |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Fey::ORM::Schema - Provides sugar for schema-based classes |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
version 0.47 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SYNOPSIS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
package MyApp::Schema; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use Fey::ORM::Schema; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has_schema ...; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
no Fey::ORM::Schema; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 DESCRIPTION |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Use this class to associate your class with a schema. It exports a |
71
|
|
|
|
|
|
|
number of sugar functions to allow you to define things in a |
72
|
|
|
|
|
|
|
declarative manner. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 EXPORTED FUNCTIONS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This package exports the following functions: |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 has_schema($schema) |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Given a L<Fey::Schema> object, this method associates that schema with |
81
|
|
|
|
|
|
|
the calling class. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This software is copyright (c) 2011 - 2015 by Dave Rolsky. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
92
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |