How I can get the id of the record in method add?

I want to create an add method but take a parameter to save the record in the database without having to enter from the sight of the value of name.

I have a table meseros with the following fields:
id -> int(11)
dni->int(100)
name -> string -> 255
code -> int(255)

So in view of this function we have:

echo $this->Form->create(‘Mesero’);
echo $this->Form->input(‘dni’);
echo $this->Form->input(‘name’);
echo $this->Form->end(‘Agregar Crear Mesero’);

The value containing $code will be sent from another controller that calls the following function add:

public function add($apellido=null)
{
if ($this->request->is(‘post’))
{
$this->Foto->create();
if ($this->Foto->save($this->request->data))
{
$this->Session->setFlash(‘The mesero ha sido guardada.’,‘default’,array(‘class’=>‘success’));
return $this->redirect(array(‘action’ => ‘index’));
}
else
{
$this->Session->setFlash(__(‘The mesero could not be saved. Please, try again.’));
}
}

In this particular case, I create the record but I have not desired code.
How can you solve this problem that I expose you?

How I can get the id of the record you just created (with create ()) and save (to save ()) ?

This last question really interests me.

Thanks!