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

getLaserDeferralReasonForSide() public method

returns the reason the injection has been deferred (switches between text value of fk, or the entered 'other' reason).
public getLaserDeferralReasonForSide ( string $side ) : mixed | string
$side string
return mixed | string
    public function getLaserDeferralReasonForSide($side)
    {
        if (!in_array($side, array('left', 'right'))) {
            throw new Exception('unrecognised side attribute ' . $side);
        }
        if ($side == 'left' && $this->hasLeft() || $this->hasRight()) {
            if ($this->{$side . '_laser_deferralreason'}) {
                if ($this->{$side . '_laser_deferralreason'}->other) {
                    return $this->{$side . '_laser_deferralreason_other'};
                } else {
                    return $this->{$side . '_laser_deferralreason'}->name;
                }
            } else {
                // shouldn't get to this point really
                return 'N/A';
            }
        }
    }