Parameter for Model::validates() is now deprecated

Published on and tagged with cakephp  model  validation

Since changeset 4260 the following usage of Model::validates(), used to validate a model without saving it, is deprecated and causes a warning:

if ($this->User->validates($this->data)) { // do something }

It looks now:

$this->User->data = $this->data;  // or $this->data['User'];
if ($this->User->validates()) { // do something }

At the moment this change affects only those who use the Cake 1.2 branch from the repository.

9 comments baked

© daniel hofstetter. Licensed under a Creative Commons License