I'm inserting some values onto employees
table using this in the controller:
$this->Employee->create();
if ($this->CoreProgram->save($this->request->data)) {
$this->Session->setFlash('Program has been added.');
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash('Unable to add record.');
}
However, I want to insert a record to another table audit
. More specifically, the current date along with employee_id
field that I used for employees
. What is the best approach to do this? Should I just create $this->Audit->create();
? Or is there a better way?