« blib/lib/DBIO/Test/Schema/CD_to_Producer.pm
↑ Summary
blib/lib/DBIO/Test/Schema/CollectionObject.pm »
| 1 | package DBIO::Test::Schema::Collection; | ||
| 2 | # ABSTRACT: Test result class for the collection table | ||
| 3 | |||
| 4 | 256 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 256 | our $VERSION = '0.900007'; | |
| 7 | |||
| 8 | 256 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 256 | ▶ | use base qw/DBIO::Test::BaseResult/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 256 | __PACKAGE__->table('collection'); | |
| 13 | 256 | __PACKAGE__->add_columns( | |
| 14 | 'collectionid' => { | ||
| 15 | data_type => 'integer', | ||
| 16 | is_auto_increment => 1, | ||
| 17 | }, | ||
| 18 | 'name' => { | ||
| 19 | data_type => 'varchar', | ||
| 20 | size => 100, | ||
| 21 | }, | ||
| 22 | ); | ||
| 23 | 256 | __PACKAGE__->set_primary_key('collectionid'); | |
| 24 | |||
| 25 | 256 | __PACKAGE__->has_many( collection_object => "DBIO::Test::Schema::CollectionObject", | |
| 26 | { "foreign.collection" => "self.collectionid" } | ||
| 27 | ); | ||
| 28 | 256 | __PACKAGE__->many_to_many( objects => collection_object => "object" ); | |
| 29 | 256 | __PACKAGE__->many_to_many( pointy_objects => collection_object => "object", | |
| 30 | { where => { "object.type" => "pointy" } } | ||
| 31 | ); | ||
| 32 | 256 | __PACKAGE__->many_to_many( round_objects => collection_object => "object", | |
| 33 | { where => { "object.type" => "round" } } | ||
| 34 | ); | ||
| 35 | |||
| 36 | 256 | 1; | |
| 37 | |||
| 38 | __END__ | ||