Working with the CakePHP 3.0 beta, seems like a simple problem, but I've searched through the docs and can't find anything. After inserting a new record using $this->Model->save(), I'd like to the get the auto_increment primary key ID of the newly created record.
With Cake 2.x, I could do:
$record_id=$this->ModelName->id;
or
$record_id=$this->ModelName->getLastInsertID();
However neither of those seems to work in CakePHP 3.0.
Thanks
Finally found the answer, if anybody else runs into this do:
$result=$this->ModelName->save($whatever);
$record_id=$result->id;