Author: spadkins
Date: Tue Sep 4 08:45:46 2007
New Revision: 9914
Modified:
p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm
Log:
Perform substitutions on sql when the value domain is specified with sql.
Modified: p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/ValueDomain/Repository.pm Tue Sep 4
08:45:46 2007
@@ -55,7 +55,7 @@
* Throws: App::Exception
* Since: 0.01
- Sample Usage:
+ Sample Usage:
$self->_load();
@@ -143,6 +143,7 @@
if ($self->{order_by}) {
$options = { order_by => $self->{order_by} };
}
+
$rows = $rep->get_rows($table, $subst_params, [EMAIL PROTECTED],
$options);
$values = [];
$labels = {};
@@ -175,7 +176,8 @@
}
if ($sql) {
- $sql = $self->substitute($sql, undef, {undef_value => "NULL"});
+ my $vals = ($values_string eq '') ? undef : {values_string =>
$values_string};
+ $sql = $self->substitute($sql, $vals, {undef_value => "NULL"});
my $rows = $rep->_do($sql);
foreach my $row (@$rows) {
@@ -187,7 +189,7 @@
$self->{labels} = $labels;
$time = time();
$self->{time} = $time;
- }
+ }
}
$values = [] if (! defined $values);