Hi Guys, i have two tables: Client and Log, Log has a simple foreign
key to Client. A client belongs to an user in time, so the Log table
saves who has the client actually.
i'm saving Clients normally with a form, but i also want to save in
the log accordingly through this way:
protected function doSave($con = null) {
$log_client_user = new Log();
$log_client_user->set('Client_id', $this->values['id']);
$log_client_user->set('User_code',$this->values['User_code']);
$log_client_user->set('date_acquired',$this-
>values['date_created']);
$log_client->save();
return parent::doSave($con);
}
however, a foreign key constraint error shows up. So how can i do
something like first saving the client and then saving the log in
short steps?
i also tried using this for the foreign key:
$log_client_user->set('Client_id', $this->getObject());
and also
$log_client_user->setClientId($this->getObject());
but none of them worked because $this->getObject() is still null in
the doSave() function. By the way, the save() fuction has the same
problem.
Can you hrlp me, please? Thanks in advance!
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en