Skip to content

Commit

Permalink
Merge pull request #5 from jonasdekeukelaere/creating-clients
Browse files Browse the repository at this point in the history
Fix loading clients from api
  • Loading branch information
jonasdekeukelaere authored Aug 5, 2024
2 parents edc012d + 4dd42a5 commit 6b6ce1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,12 @@ public function setDisabled(bool $disabled = true): Client
public static function initializeWithRawData(array $data): Client
{
$item = new Client(
$data['last_name'] ?? '',
$data['email'] ?? '',
Address::initializeWithRawData($data['billing_address'] ?? []),
Address::initializeWithRawData($data['company_address'] ?? [])
Address::initializeWithRawData($data['company_address'] ?? []),
$data['last_name'] ?? null,
$data['company'] ?? null,
$data['vat'] ?? null,
);

if(isset($data['id'])) $item->setId($data['id']);
Expand Down

0 comments on commit 6b6ce1f

Please sign in to comment.