Support for relationship attributes in many_to_many accessors.
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Collection.pm
1 package # hide from PAUSE \r
2     DBICTest::Schema::Collection;\r
3 \r
4 use base qw/DBIx::Class::Core/;\r
5 \r
6 __PACKAGE__->table('collection');\r
7 __PACKAGE__->add_columns(\r
8   'collectionid' => {\r
9     data_type => 'integer',\r
10     is_auto_increment => 1,\r
11   },\r
12   'name' => {\r
13     data_type => 'varchar',\r
14     size      => 100,\r
15   },\r
16 );\r
17 __PACKAGE__->set_primary_key('collectionid');\r
18 \r
19 __PACKAGE__->has_many( collection_object => "DBICTest::Schema::CollectionObject",\r
20                        { "foreign.collection" => "self.collectionid" }\r
21                      );\r
22 __PACKAGE__->many_to_many( objects => collection_object => "object" );\r
23 __PACKAGE__->many_to_many( pointy_objects => collection_object => "object",\r
24                            { where => { "type" => "pointy" } } \r
25                          );\r
26 __PACKAGE__->many_to_many( round_objects => collection_object => "object",\r
27                            { where => { "type" => "round" } } \r
28                          );\r
29 \r
30 1;\r