mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 03:14:33 -04:00
Handle single contact object passed into array
This commit is contained in:
parent
bfff515b59
commit
b35bdebccf
@ -29,9 +29,15 @@ class ClientContactRepository extends BaseRepository
|
|||||||
public function save(array $data, Client $client) : void
|
public function save(array $data, Client $client) : void
|
||||||
{
|
{
|
||||||
|
|
||||||
if (isset($data['contacts'])) {
|
if (isset($data['contacts']) && (count($data['contacts']) !== count($data['contacts'], COUNT_RECURSIVE))) {
|
||||||
$contacts = collect($data['contacts']);
|
$contacts = collect($data['contacts']);
|
||||||
} else {
|
} elseif(isset($data['contacts'])){
|
||||||
|
|
||||||
|
$temp_array[] = $data['contacts'];
|
||||||
|
$contacts = collect($temp_array);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
$contacts = collect();
|
$contacts = collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user