Model->setId() is deprecated

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

  1. Posted January 30, 2006 at 6:55 pm | Permalink

    You can also use it like
    $this->Model->read($theId);


%d bloggers like this: