Gdn_Validation::unapplyRule PHP Метод

unapplyRule() публичный Метод

Remove a validation rule that was added with {@link Gdn_Validation::ApplyRule()}.
public unapplyRule ( $FieldName, boolean $RuleName = false )
$FieldName
$RuleName boolean
    public function unapplyRule($FieldName, $RuleName = false)
    {
        if ($RuleName) {
            if (isset($this->_FieldRules[$FieldName])) {
                $Index = array_search($RuleName, $this->_FieldRules[$FieldName]);
                if ($Index !== false) {
                    unset($this->_FieldRules[$FieldName][$Index]);
                }
            }
            if (array_key_exists($FieldName, $this->getSchemaRules())) {
                $Index = array_search($RuleName, $this->_SchemaRules[$FieldName]);
                if ($Index !== false) {
                    unset($this->_SchemaRules[$FieldName][$Index]);
                }
            }
        } else {
            $this->getSchemaRules();
            unset($this->_FieldRules[$FieldName], $this->_ValidationFields[$FieldName], $this->_SchemaRules[$FieldName]);
        }
    }