|
|
@@ -1298,25 +1298,6 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Add a validation rule to ensure a field is a money value.
|
|
|
- *
|
|
|
- * @param string $field The field you want to apply the rule to.
|
|
|
- * @param string $symbolPosition The position of the currency symbol
|
|
|
- * @param string|null $message The error message when the rule fails.
|
|
|
- * @param string|callable|null $when Either 'create' or 'update' or a callable that returns
|
|
|
- * true when the validation rule should be applied.
|
|
|
- * @see \Cake\Validation\Validation::money()
|
|
|
- * @return $this
|
|
|
- */
|
|
|
- public function money($field, $symbolPosition = 'left', $message = null, $when = null)
|
|
|
- {
|
|
|
- $extra = array_filter(['on' => $when, 'message' => $message]);
|
|
|
- return $this->add($field, 'money', $extra + [
|
|
|
- 'rule' => ['money', $symbolPosition]
|
|
|
- ]);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* Add a validation rule for a multiple select. Comparison is case sensitive by default.
|
|
|
*
|
|
|
* @param string $field The field you want to apply the rule to.
|