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

requiredIfLaserTypeOther() public method

public requiredIfLaserTypeOther ( $attribute, $params )
$attribute
$params
    public function requiredIfLaserTypeOther($attribute, $params)
    {
        $lasertype_attr = $params['lasertype'];
        $lt = $this->{$lasertype_attr};
        if ($lt && $lt->other) {
            $v = \CValidator::createValidator('required', $this, array($attribute), array('message' => ucfirst($params['side']) . ' {attribute} required for laser type ' . $lt->name));
            $v->validate($this);
        }
    }