line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Fey::Meta::Attribute::FromColumn; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
52
|
use strict; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
363
|
|
4
|
10
|
|
|
10
|
|
50
|
use warnings; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
363
|
|
5
|
10
|
|
|
10
|
|
55
|
use namespace::autoclean; |
|
10
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
96
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.47'; |
8
|
|
|
|
|
|
|
|
9
|
10
|
|
|
10
|
|
922
|
use Moose; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
77
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends 'Moose::Meta::Attribute'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has 'column' => ( |
14
|
|
|
|
|
|
|
is => 'ro', |
15
|
|
|
|
|
|
|
isa => 'Fey::Column', |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# The parent class's constructor is not a Moose::Object-based |
20
|
|
|
|
|
|
|
# constructor, so we don't want to inline one that is. |
21
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable( inline_constructor => 0 ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# ABSTRACT: An attribute metaclass for column-based attributes |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Fey::Meta::Attribute::FromColumn - An attribute metaclass for column-based attributes |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 VERSION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
version 0.47 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
package MyApp::Song; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has_table( $schema->table('Song') ); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
for my $attr ( grep { $_->can('column') } $self->meta()->get_all_attributes ) |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
... |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
This attribute metaclass is used when L<Fey::ORM::Table> creates |
53
|
|
|
|
|
|
|
attributes for the class's associated table. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This class adds a single method to those provided by |
58
|
|
|
|
|
|
|
C<Moose::Meta::Attribute>: |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 $attr->column() |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Returns the L<Fey::Column> object associated with this attribute. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2011 - 2015 by Dave Rolsky. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |