mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
contacts array sorter
This commit is contained in:
parent
c84d75e7bf
commit
b49938e36d
@ -100,6 +100,10 @@ class ClientRepository extends BaseRepository
|
|||||||
$contacts = isset($data['contact']) ? [$data['contact']] : $data['contacts'];
|
$contacts = isset($data['contact']) ? [$data['contact']] : $data['contacts'];
|
||||||
$contactIds = [];
|
$contactIds = [];
|
||||||
|
|
||||||
|
$contacts = usort($contacts, function ($left, $right) {
|
||||||
|
return $left['priority'] - $right['priority'];
|
||||||
|
});
|
||||||
|
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
$contact = $client->addContact($contact, $first);
|
$contact = $client->addContact($contact, $first);
|
||||||
$contactIds[] = $contact->public_id;
|
$contactIds[] = $contact->public_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user