Gdn_Validation::setSchemaProperty PHP Method

setSchemaProperty() public method

Allows you to explicitly set a field property on $this->_Schema. Can be useful when adding rules to fields (ie. a maxlength property on a db's text field).
public setSchemaProperty ( string $FieldName, string $PropertyName, mixed $Value )
$FieldName string The name of the field that we are setting a property for.
$PropertyName string The name of the property being set.
$Value mixed The value of the property to set.
    public function setSchemaProperty($FieldName, $PropertyName, $Value)
    {
        if (is_array($this->_Schema) && array_key_exists($FieldName, $this->_Schema)) {
            $Field = $this->_Schema[$FieldName];
            if (is_object($Field)) {
                $Field->{$PropertyName} = $Value;
                $this->_Schema[$FieldName] = $Field;
            }
        }
    }