cakephp logo

Validates function deprecated warning 512 in CakePHP 1.2

While trying to implement a simple authorization login using the cakephp (1.2 rev 6311) AuthComponent I struck the following warning for the controller $this->Model->validates($data) function call :-

  • Warning (512): (Model::validates) Parameter usage is deprecated, set the $data property instead [CORE/cake/libs/model/model.php, line 1660]

The new way of doing this is to use the Models set() function before validate is called, as follows :-

Show Plain Text
PHP code
  1. $this->Model->set($this->data);
  2. if ($this->Model->validates()){
  3. }

Filed under: Cakephp  Tags: Validation

0 Responses to “Validates function deprecated warning 512 in CakePHP 1.2”

Sorry, comments have been closed for this post.