Model->setId() is deprecated

Published on and tagged with cakephp  programming  tip

You may have noticed that the function setId() in the model is deprecated since release candidate 1. But what is the alternative? The alternative is to use the public variable “id” like:

$this->Model->id = $theId;

The function setId() still works, but according to PhpNut it will be removed in version 1.0 of CakePHP.

One comment baked

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License