Fixes for base repo

This commit is contained in:
David Bomba 2023-02-22 18:07:00 +11:00
parent 2fe47f572a
commit 392a4e5ccb

View File

@ -146,8 +146,9 @@ class BaseRepository
* @throws \ReflectionException
*/
protected function alternativeSave($data, $model)
{
if (array_key_exists('client_id', $data) && !empty($data['client_id'])) {
{ //$start = microtime(true);
//forces the client_id if it doesn't exist
if (array_key_exists('client_id', $data)) {
$model->client_id = $data['client_id'];
}
@ -176,6 +177,7 @@ class BaseRepository
if (isset($tmp_data['client_contacts'])) {
unset($tmp_data['client_contacts']);
}
$model->fill($tmp_data);
@ -195,7 +197,7 @@ class BaseRepository
});
}
}
}
$model->saveQuietly();
/* Model now persisted, now lets do some child tasks */