Если вы делаете вставку (так как это «добавление»), маловероятно, что вы можете выполнить все за один шаг, поскольку MySQL не будет знать идентификатор вашего ресторана, чтобы сэкономить часы работы.Я бы предложил сделать следующее:
$this->Restaurant->create();
if($this->Restaurant->save($this->data, array('validate' => 'first'))) {
$this->data['rest_id'] = $this->Restaurant->getLastInsertId();
if($this->Restaurant->OperatingHours->save($this->data, array('validate' => 'first'))) {
$this->Session->setFlash(__('The restaurant has been saved', true));
//$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The restaurant opening hours could not be saved. Please, try again.', true));
}
} else {
$this->Session->setFlash(__('The restaurant could not be saved. Please, try again.', true));
}