File Coverage

blib/lib/DBIx/Class/Wrapper/Object.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package DBIx::Class::Wrapper::Object;
2             $DBIx::Class::Wrapper::Object::VERSION = '0.009';
3 4     4   51896 use Moose;
  4         10  
  4         24  
4             has 'factory' => ( isa => 'DBIx::Class::Wrapper::Factory' , required => 1 , is => 'ro' );
5              
6             =head1 NAME
7              
8             DBIx::Class::Wrapper::Object - Base class for object containing business code around another DBIC object.
9              
10             =head1 PROPERTIES
11              
12             =over
13              
14             =item bm
15              
16             The business model. Mandatory.
17              
18             =back
19              
20             =head1 EXAMPLE
21              
22             package My::BM::O::User;
23             use Moose;
24             extends qw/DBIx::Class::Wrapper::Object/;
25              
26             has 'dbuser' => ( isa => 'My::Schema::Result::User' , is => 'ro' , required => 1 , handles => qw/.*/ );
27              
28             sub check_password{
29             my ($self , $password) = @_;
30             return $self->password() eq $password; # Do NOT do that :)
31             }
32             1;
33              
34             =cut
35              
36             __PACKAGE__->meta->make_immutable();
37             1;