t/testlib/MyFilm.pm
raw| 1 | package MyFilm; |
| 2 | |
| 3 | BEGIN { unshift @INC, './t/testlib'; } |
| 4 | use base 'MyBase'; |
| 5 | use MyStarLink; |
| 6 | |
| 7 | use strict; |
| 8 | |
| 9 | __PACKAGE__->set_table(); |
| 10 | __PACKAGE__->columns(All => qw/filmid title/); |
| 11 | __PACKAGE__->has_many(_stars => 'MyStarLink'); |
| 12 | __PACKAGE__->columns(Stringify => 'title'); |
| 13 | |
| 14 | sub _carp { } |
| 15 | |
| 16 | sub stars { map $_->star, shift->_stars } |
| 17 | |
| 18 | sub create_sql { |
| 19 | return qq{ |
| 20 | filmid TINYINT NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| 21 | title VARCHAR(255) |
| 22 | }; |
| 23 | } |
| 24 | |
| 25 | 1; |
| 26 |