Lines 1485-1491
sub _get_tt_params {
Link Here
|
1485 |
my $id = ref $ref eq 'HASH' ? $tables->{$table}->{$pk} : $tables->{$table}; |
1485 |
my $id = ref $ref eq 'HASH' ? $tables->{$table}->{$pk} : $tables->{$table}; |
1486 |
my $object; |
1486 |
my $object; |
1487 |
if ( $fk ) { # Using a foreign key for lookup |
1487 |
if ( $fk ) { # Using a foreign key for lookup |
1488 |
$object = $module->search( { $fk => $id } )->next(); |
1488 |
if ( ref( $fk ) eq 'ARRAY' ) { # Foreign key is multi-column |
|
|
1489 |
my $search; |
1490 |
foreach my $key ( @$fk ) { |
1491 |
$search->{$key} = $id->{$key}; |
1492 |
} |
1493 |
$object = $module->search( $search )->next(); |
1494 |
} else { # Foreign key is single column |
1495 |
$object = $module->search( { $fk => $id } )->next(); |
1496 |
} |
1489 |
} else { # using the table's primary key for lookup |
1497 |
} else { # using the table's primary key for lookup |
1490 |
$object = $module->find($id); |
1498 |
$object = $module->find($id); |
1491 |
} |
1499 |
} |
1492 |
- |
|
|