initial checkin for UserStamp
[dbsrgits/DBIx-Class-UserStamp.git] / t / lib / DBIC / Test / Schema / Accessor.pm
CommitLineData
7bde9079 1package #
2 DBIC::Test::Schema::Accessor;
3
4use base 'DBIx::Class::Core';
5
6__PACKAGE__->load_components(qw/UserStamp PK::Auto Core/);
7__PACKAGE__->table('test_accessor');
8
9__PACKAGE__->add_columns(
10 'pk1' => {
11 data_type => 'integer', is_nullable => 0, is_auto_increment => 1
12 },
13 display_name => { data_type => 'varchar', size => 128, is_nullable => 0 },
14 u_created => {
15 data_type => 'integer', is_nullable => 0,
16 store_user_on_create => 1, accessor => 'u_created_accessor',
17 },
18 u_updated => {
19 data_type => 'integer', is_nullable => 0,
20 store_user_on_create => 1, store_user_on_update => 1, accessor => 'u_updated_accessor',
21 },
22);
23
24__PACKAGE__->set_primary_key('pk1');
25
26no warnings 'redefine';
27
28sub u_created {
29 my $self = shift;
30 croak('Shouldnt be trying to update through u_created - should use accessor') if shift;
31
32 return $self->u_created_accessor();
33}
34
35sub u_updated {
36 my $self = shift;
37 croak('Shouldnt be trying to update through u_updated - should use accessor') if shift;
38
39 return $self->u_updated_accessor();
40}
41
42
431;