コード例 #1
0
 protected function size_unit_converter_to_any($unit_value, $from_unit_type, $to_any_type)
 {
     $MeasurementFactoryObj = MeasurementFactory::build($from_unit_type);
     try {
         return $MeasurementFactoryObj->get_result($to_any_type, $unit_value);
     } catch (Exception $e) {
         $this->set_error("Invalid unit type: " . $from_unit_type);
         $this->set_error($e);
         return FALSE;
     }
 }