OEModule\OphCiExamination\models\Element_OphCiExamination_LaserManagement::getLaserTypeStringForSide PHP Method

getLaserTypeStringForSide() public method

returns the laser type for the given side.
public getLaserTypeStringForSide ( string $side ) : string
$side string
return string
    public function getLaserTypeStringForSide($side)
    {
        if (!in_array($side, array('left', 'right'))) {
            throw new Exception('unrecognised side attribute ' . $side);
        }
        if ($lt = $this->{$side . '_lasertype'}) {
            if ($lt->other) {
                return $this->{$side . '_lasertype_other'};
            } else {
                return $lt->name;
            }
        }
        return 'N/A';
    }