return true;
}
- private function getValue($line, $key, $action)
+ static public function getValue($line, $key, $action, $relation = null)
{
if (@array_key_exists($action, $line)) {
$value = $line[$action];
} elseif (is_callable($action, false)) {
- $value = call_user_func($action, $line, $key);
+ $value = call_user_func($action, $line, $key, $relation);
} else {
$value = $action;
}
{
$ops = array();
foreach ($relation as $key=>$ref) {
- $ops[$key] = $this->getValue($line, $key, $ref);
+ $ops[$key] = $this->getValue($line, $key, $ref, $relation);
}
return $ops;
}
{
$ops = array();
foreach ($relation as $key=>$ref) {
- $value = $this->getValue($line, $key, $ref);
+ $value = $this->getValue($line, $key, $ref, $relation);
if (!is_null($value) && $value != 'NULL') {
$value = "'" . addslashes($value) . "'";
}