OEModule\PatientTicketing\models\Queue::validJSON PHP Method

validJSON() public method

Checks the given attribute is valid JSON.
public validJSON ( $attribute )
$attribute
    public function validJSON($attribute)
    {
        if ($this->{$attribute}) {
            if (!\CJSON::decode($this->{$attribute})) {
                $this->addError($attribute, $this->getAttributeLabel($attribute) . ' must be valid JSON');
            }
        }
    }