hi all, I had written a validation function which takes 2 parameters...validation is working fine....but when i try use save() or update() function then it validates the data and as i am not sending any parameters it fails....How can i rectify this? my function for validation is
public function validation($min_amount, $max_amount) {
$validator = new Validation();
$validator->add('first_name', new PresenceOf([
'message' => 'First Name cannot be null'
]));
$validator->add('last_name', new PresenceOf([
'message' => 'Last Name cannot be null'
]));
$validator->add('amount', new PresenceOf([
'message' => 'Amount cannot be null'
]));
$validator->add('amount', new Between([
'maximum' => $max_amount,
'minimum' => $min_amount,
'message' => "The amount should be between" . $min_amount . " and " . $max_amount,
]));
return $this->validate($validator);
}