/** Set the property value for the object * If a setter method exists, use the method and answer result. * else set field value */ function setValue_for($value, $obj) { $name = $this->getName(); $mth = "set$name"; if (method_exists($obj, $mth)) return $obj->$mth($value); //use setter method if there else return $this->propagateValue_for($value, $obj); } |