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';
}
}
}