File: Dvd.pm

package info (click to toggle)
libdbix-class-resultset-recursiveupdate-perl 0.45-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,060 kB
  • sloc: perl: 5,130; sql: 640; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,865 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package DBSchema::Result::Dvd;

# Created by DBIx::Class::Schema::Loader v0.03000 @ 2006-10-02 08:24:09

use strict;
use warnings;

use base 'DBIx::Class';
use overload '""' => sub {$_[0]->name}, fallback => 1;

__PACKAGE__->load_components(qw/IntrospectableM2M Core/);
__PACKAGE__->table('dvd');
__PACKAGE__->add_columns(
  'dvd_id' => {
    data_type => 'integer',
    is_auto_increment => 1
  },
  'name' => {
    data_type => 'varchar',
    size      => 100,
    is_nullable => 1,
  },
  'imdb_id' => {
    data_type => 'varchar',
    size      => 100,
    is_nullable => 1,
  },
  'owner' => { data_type => 'integer' },
  'current_borrower' => { 
    data_type => 'integer', 
    is_nullable => 1,
  },

  'creation_date' => { 
    data_type => 'datetime',
    is_nullable => 1,
  },
  'alter_date' => { 
    data_type => 'datetime',
    is_nullable => 1,
  },
);
__PACKAGE__->set_primary_key('dvd_id');
__PACKAGE__->belongs_to('owner', 'DBSchema::Result::User', 'owner');
__PACKAGE__->belongs_to('current_borrower', 'DBSchema::Result::User', 'current_borrower', { join_type => "LEFT" });
__PACKAGE__->has_many('dvdtags', 'Dvdtag', { 'foreign.dvd' => 'self.dvd_id' });
__PACKAGE__->has_many('viewings', 'DBSchema::Result::Viewing', { 'foreign.dvd_id' => 'self.dvd_id' });
__PACKAGE__->many_to_many('tags', 'dvdtags' => 'tag');
# same relationship with a name that's different from the column name
__PACKAGE__->many_to_many('rel_tags', 'dvdtags' => 'rel_tag');
__PACKAGE__->might_have(
    liner_notes => 'DBSchema::Result::LinerNotes', undef,
    { proxy => [ qw/notes/ ] },
);
__PACKAGE__->add_relationship('like_has_many', 'DBSchema::Result::Twokeys', { 'foreign.dvd_name' => 'self.name' }, { accessor => 'multi', accessor_name => 'like_has_many' } );

__PACKAGE__->has_many(
    keysbymethod => 'KeysByMethod',
    { 'foreign.dvd' => 'self.dvd_id' }
);

1;