File Coverage

blib/lib/OpusVL/Preferences/Schema/Result/PrfOwner.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1              
2             package OpusVL::Preferences::Schema::Result::PrfOwner;
3              
4 1     1   1924 use strict;
  1         2  
  1         27  
5 1     1   4 use warnings;
  1         2  
  1         20  
6 1     1   5 use Moose;
  1         2  
  1         5  
7 1     1   5511 use MooseX::NonMoose;
  1         2  
  1         7  
8 1     1   4439 use namespace::autoclean;
  1         2  
  1         9  
9              
10             extends 'DBIx::Class::Core';
11              
12             __PACKAGE__->table("prf_owners");
13              
14             __PACKAGE__->add_columns
15             (
16             prf_owner_id =>
17             {
18             data_type => "integer",
19             is_nullable => 0
20             },
21              
22             prf_owner_type_id =>
23             {
24             data_type => "integer",
25             is_nullable => 0,
26             },
27             );
28              
29             __PACKAGE__->set_primary_key("prf_owner_id", "prf_owner_type_id");
30              
31              
32             __PACKAGE__->has_many
33             (
34             prf_preferences => "OpusVL::Preferences::Schema::Result::PrfPreference",
35             {
36             "foreign.prf_owner_id" => "self.prf_owner_id",
37             "foreign.prf_owner_type_id" => "self.prf_owner_type_id",
38             },
39             { join_type => 'left' }
40             );
41              
42             __PACKAGE__->belongs_to
43             (
44             prf_owner_types => 'OpusVL::Preferences::Schema::Result::PrfOwnerType',
45             {
46             'foreign.prf_owner_type_id' => 'self.prf_owner_type_id'
47             }
48             );
49              
50             __PACKAGE__->has_many
51             (
52             _by_name => 'OpusVL::Preferences::Schema::Result::PrfPreference',
53             sub {
54             my $args = shift;
55             return (
56             {
57             "$args->{foreign_alias}.prf_owner_id" => { -ident => "$args->{self_alias}.prf_owner_id" },
58             "$args->{foreign_alias}.prf_owner_type_id" => { -ident => "$args->{self_alias}.prf_owner_type_id" },
59             "$args->{foreign_alias}.name" => \"= ?",
60             }
61             );
62             },
63             );
64              
65              
66             return 1;
67              
68             __END__
69              
70             =pod
71              
72             =encoding UTF-8
73              
74             =head1 NAME
75              
76             OpusVL::Preferences::Schema::Result::PrfOwner
77              
78             =head1 VERSION
79              
80             version 0.27
81              
82             =head1 DESCRIPTION
83              
84             =head1 METHODS
85              
86             =head1 ATTRIBUTES
87              
88             =head2 prf_preferences
89              
90             =head2 prf_owner_types
91              
92             =head2 prf_owner_id
93              
94             =head2 prf_owner_type_id
95              
96             =head1 LICENSE AND COPYRIGHT
97              
98             Copyright 2012 OpusVL.
99              
100             This software is licensed according to the "IP Assignment Schedule" provided with the development project.
101              
102             =head1 AUTHOR
103              
104             OpusVL - www.opusvl.com
105              
106             =head1 COPYRIGHT AND LICENSE
107              
108             This software is copyright (c) 2011 by OpusVL - www.opusvl.com.
109              
110             This is free software; you can redistribute it and/or modify it under
111             the same terms as the Perl 5 programming language system itself.
112              
113             =cut