Delete a validation rule

@param   string|Callback	either a validation rule or full callback
@param   bool	whether to also reset related attributes
@return  Fieldset_Field  this, to allow chaining
542834
public function delete_rule($callback, $set_attr = true)
	{
		foreach($this->rules as $index => $rule)
		{
			if ($rule[0] === $callback)
			{
				unset($this->rules[$index]);
				break;
			}
		}

		if ($callback === 'required' and $set_attr)
		{
			unset($this->attributes[$callback]);
		}

		return $this;
	}
129103
public function validateFieldValue($sFieldValue)
    {
        $blValid = true;
        if (is_array($sFieldValue)) {
            $blValid = $this->_validateFieldValueArray($sFieldValue);
        } else {
            if (!trim($sFieldValue)) {
                $blValid = false;
            }
        }

        return $blValid;
    }
701824
public function removeFields($fieldset = null, $group = null)
    {
        foreach ($this->fields as $current) {
            if ($fieldset && $current->getFieldset() != $fieldset) {
                $this->removeField($current->getName(true));
            }

            if ($group && $current->getGroup() != $group) {
                $this->removeField($current->getName(true));
            }
        }

        return $this;
    }
928951
function(attr, options) {
      if (!(attr in this.attributes)) return this;
      options || (options = {});
      var value = this.attributes[attr];

      // Run validation.
      var validObj = {};
      validObj[attr] = void 0;
      if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;

      // Remove the attribute.
      delete this.attributes[attr];
      delete this._escapedAttributes[attr];
      if (attr == this.idAttribute) delete this.id;
      this._changed = true;
      if (!options.silent) {
        this.trigger('change:' + attr, this, void 0, options);
        this.change(options);
      }
      return this;
    }
422876
public function setRequired(bool $required = true)
    {
        if ($required) {
            $this->field->addProp('required');
        } else {
            $this->field->removeProp('required');
        }

        return $this;
    }
302842
public function validate($field, $value, callable $callback = null)
    {
        $key = $field;

        if (is_array($field)) {
            $key = key($field);
            $field = current($field);
        }

        if ($callback !== null) {
            $value = $callback($value);
        }

        while (!empty($this->stack)) {
            $item = array_shift($this->stack);

            if (null === $validator = $this->collection->get($item['name'])) {
                throw new RuntimeException('Unknown validator `' . $item['name'] . '`');
            }

            $arguments = $validator->getFormattedArgs($item['arguments']);

            if ($validator->validate($value, $arguments)) {
                continue;
            }

            $this->stack = [];
            $this->errors[$key] = $this->formatError($field, $validator, $validator, $arguments,
                $item['error'] ?? null);

            break;
        }

        return $value;
    }
454464
public function applyRules($field, $ruleset)
    {
        // Save previous values, just in case
        $acc = $this->acc;
        $crs = $this->current_ruleset;
        $this->bail_out = false;

        $this->acc = $this->get($field);
        $this->current_ruleset = $ruleset;

        while (!is_null($rule = $this->pullRule())) {
            $this->cast = false;
            $this->custom_error = null;

            if ($rule == 'required') {
                $is_required = true;
            }

            // For debugging
            $tmp = null;
            $this->consumed = array($rule);

            try {
                if ((is_object($rule) || is_array($rule)) && is_callable($rule)) {
                    $tmp = $rule($this, $this->acc, $field);
                } else {
                    // For to_XX rules
                    if (substr($rule, 0, 3) == 'to_') {
                        if (!$this->hasMethod('rule_'.$rule)) {
                            $rule = substr($rule, 3);
                        }

                        $this->cast = true;
                    }

                    if ($rule === '') {
                        if ($this->cast) {
                            $this->set($field, $this->acc);
                        }
                        continue;
                    }

                    $rule = $this->resolveRuleAlias($rule);

                    $tmp = $this->{'rule_'.$rule}($this->acc, $field);
                }

                if ($this->debug) {
                    echo "<font color=blue>rule_$rule({$this->acc},".
                    implode(',', $this->consumed).")=$tmp</font><br/>";
                }

                if (!is_null($tmp)) {
                    $this->acc = $tmp;
                }
                if ($this->cast) {
                    $this->set($field, $tmp);
                }
                if ($this->bail_out) {
                    break;
                }
            } catch (\Exception_ValidityCheck $e) {
                if ($this->debug) {
                    echo "<font color=red>rule_$rule({$this->acc},".
                        implode(',', $this->consumed).') failed</font><br/>';
                }
                $this->acc = $acc;
                $this->current_ruleset = $crs;
                throw $e
                    ->setField($field)
                    ->addMoreInfo('val', $this->acc)
                    ->addMoreInfo('rule', $rule);
            }
        }
        $this->acc = $acc;
        $this->current_ruleset = $crs;
    }
802487
public function removeField(FormField $field)
    {
        if ($this->fields->contains($field) === true) {
            $field->setForm(null);
            $this->fields->removeElement($field);
        }

        return $this;
    }
35858
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case NAME:
      return isSetName();
    case VALIDATION_CLASS:
      return isSetValidation_class();
    case INDEX_TYPE:
      return isSetIndex_type();
    case INDEX_NAME:
      return isSetIndex_name();
    case INDEX_OPTIONS:
      return isSetIndex_options();
    }
    throw new IllegalStateException();
  }
959518
public function removeField($field)
    {
        $this->checkValidLoader();

        if (in_array($field, $this->loaders[ $this->contextLoader ])) {
            array_splice(
                $this->loaders[ $this->contextLoader ],
                array_search($field, $this->loaders[ $this->contextLoader ])
            );
        }

        return $this;
    }
559793
protected function validateBool($field)
    {
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $this->setSubmitted($field, (int) filter_var($value, FILTER_VALIDATE_BOOLEAN));
        return true;
    }
751244
@Override
	public boolean remove(Object object) {
		if (booleanTerms == null) {
			return false;
		}
		return booleanTerms.remove(object);
	}
1317910
public function addRule()
    {
        foreach ($this->rules as $field => $rule) {
            $this->validation->addRule($field, $rule);
        }

        return $this;
    }
589392
public function removeField(FormResponseField $field)
    {
        if ($this->fields->contains($field) === true) {
            $field->setResponse(null);
            $this->fields->removeElement($field);
        }

        return $this;
    }
825654
public function setRequired(bool $required): BaseAttribute
    {
        parent::setRequired($required);

        if ($this->getMinLength() === 0) {
            $this->setMinLength(1);
        }

        return $this;
    }
649474
public function delete()
    {
        if ($this->callbackUnset instanceof \Closure) {
            return call_user_func_array($this->callbackUnset, [$this->getId()]);
        }

        return false;
    }
629100
public function ApplyRules($Fields) {
      foreach ($Fields as $Index => $Row) {
         $Validation = GetValue('Validation', $Row);
         if (!$Validation)
            continue;
         
         $FieldName = GetValue('Name', $Row, $Index);
         if (is_string($Validation)) {
            $this->ApplyRule($FieldName, $Validation);
         } elseif (is_array($Validation)) {
            foreach ($Validation as $Rule) {
               if (is_array($Rule)) {
                  $this->ApplyRule($FieldName, $Rule[0], $Rule[1]);
               } else {
                  $this->ApplyRule($FieldName, $Rule);
               }
            }
         }
      }
   }