OEModule\OphCiExamination\models\Element_OphCiExamination_VisualAcuity::getCombined PHP Method

getCombined() public method

Get a combined string of the different readings. If a unit_id is given, the readings will be converted to unit type of that id.
public getCombined ( string $side, null $unit_id = null ) : string
$side string
$unit_id null
return string
    public function getCombined($side, $unit_id = null)
    {
        $combined = array();
        foreach ($this->{$side . '_readings'} as $reading) {
            $combined[] = $reading->convertTo($reading->value, $unit_id) . ' ' . $reading->method->name;
        }
        return implode(', ', $combined);
    }