public function __get($name) { if ($name == 'due_amount') { $m = sfInflector::camelize("get_{$name}"); return $this->{$m}(); } if (strpos($name, 'tax_amount_') === 0) { return $this->calculate($name, true); } return parent::__get($name); }