From 39e13b0fb4b323c1d8c691b0e55c37d0ca1becc5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 2 Mar 2011 15:32:40 +0100 Subject: [PATCH] =?utf8?q?Verkn=C3=BCpfungen=20Parts/Customers/Vendors=20-?= =?utf8?q?>=20Custom=20Variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Customer.pm | 6 ++++++ SL/DB/Part.pm | 16 ++++++++++++++++ SL/DB/Vendor.pm | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/SL/DB/Customer.pm b/SL/DB/Customer.pm index f2893ae74..c2c436dfd 100644 --- a/SL/DB/Customer.pm +++ b/SL/DB/Customer.pm @@ -27,6 +27,12 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::Business', column_map => { business_id => 'id' }, }, + custom_variables => { + type => 'one to many', + class => 'SL::DB::CustomVariable', + column_map => { id => 'trans_id' }, + query_args => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'CT')" ] ], + }, ); __PACKAGE__->meta->make_manager_class; diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 79ef2a482..fd53dd64e 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -37,6 +37,22 @@ __PACKAGE__->meta->add_relationships( class => 'SL::DB::Price', column_map => { id => 'parts_id' }, }, + makemodels => { + type => 'one to many', + class => 'SL::DB::MakeModel', + column_map => { id => 'parts_id' }, + }, + translations => { + type => 'one to many', + class => 'SL::DB::Translation', + column_map => { id => 'parts_id' }, + }, + custom_variables => { + type => 'one to many', + class => 'SL::DB::CustomVariable', + column_map => { id => 'trans_id' }, + query_args => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'IC')" ] ], + }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/Vendor.pm b/SL/DB/Vendor.pm index 13b70ebe2..53ac297b5 100644 --- a/SL/DB/Vendor.pm +++ b/SL/DB/Vendor.pm @@ -26,6 +26,12 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::Business', column_map => { business_id => 'id' }, }, + custom_variables => { + type => 'one to many', + class => 'SL::DB::CustomVariable', + column_map => { id => 'trans_id' }, + query_args => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'CT')" ] ], + }, ); __PACKAGE__->meta->make_manager_class; -- 2.20.1