Revize 818
Přidáno uživatelem Ondřej Fibich před téměř 14 roky(ů)
freenetis/branches/testing/application/controllers/private_phone_contacts.php | ||
---|---|---|
{ // add relation
|
||
if (!$contact->add($user_model) || !$contact->save())
|
||
{
|
||
throw new Exception('6');
|
||
throw new Exception();
|
||
}
|
||
// output
|
||
$output[] = array (
|
||
... | ... | |
$contact->value = $number_short;
|
||
if (!$contact->save())
|
||
{
|
||
throw new Exception('1');
|
||
throw new Exception();
|
||
}
|
||
|
||
if (!$contact->add($user_model) || !$contact->save())
|
||
{
|
||
throw new Exception('2');
|
||
throw new Exception();
|
||
}
|
||
|
||
if ($country != NULL && (!$contact->add($country) || !$contact->save()))
|
||
{
|
||
throw new Exception('3');
|
||
throw new Exception();
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
throw new Exception('4');
|
||
throw new Exception();
|
||
}
|
||
}
|
||
else
|
||
{ // error
|
||
throw new Exception('5 ' . (count($im_constacts)));
|
||
throw new Exception();
|
||
}
|
||
}
|
||
// commit transaction
|
||
... | ... | |
}
|
||
catch (Exception $ex)
|
||
{
|
||
$user->transaction_roolback();
|
||
$error['error_save']['error'] .= $ex->getMessage();
|
||
$user->transaction_rollback();
|
||
echo json_encode($error['error_save']);
|
||
}
|
||
}
|
Také k dispozici: Unified diff
Oprava roolback na rollback.