OEModule\OphCiExamination\models\Element_OphCiExamination_LaserManagement::getLaserTypeStringForSide PHP Méthode

getLaserTypeStringForSide() public méthode

returns the laser type for the given side.
public getLaserTypeStringForSide ( string $side ) : string
$side string
Résultat 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';
    }