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 TextPHP code
- $this->Model->set($this->data);
- if ($this->Model->validates()){
- }