Can I set the model record ID for another field value? (without update it)
In the other way, mix this code to one or two line:
$this->Model->create($data);
$this->Model->save();
$this->Model->create($data); // create again
$this->Model->set('link', $this->Model->id); // get record id
$this->Model->save(); // update
Thanks.
Yes, but you need to make the proper calls to the proper model methods. You will also need to make certain you are storing the information correctly in the array you are passing to save. So let’s say you are adding a record to the
placestable. Let’s say your schema looks like this:Then you have the following: