Permalink
Browse files

Use $data variable instead of $customerArray. Since $customerArray is…

… never defined, (almost) all data was set to null. (#47)
  • Loading branch information...
haxzorer authored and Nyholm committed Feb 1, 2018
1 parent 77648bd commit 80ce3438c4f4b980aa255793725aeec3dfd059c1
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/Model/Customer/Customer.php
@@ -294,15 +294,15 @@ public static function createFromArray(array $data): self
$customer->deliveryAddress = CustomerDeliveryAddress::createFromArray($data['delivery_address']);
}
$customer->customerNo = $customerArray['customer_no'] ?? null;
$customer->name = $customerArray['name'] ?? null;
$customer->notes = $customerArray['notes'] ?? null;
$customer->orgNo = $customerArray['org_no'] ?? null;
$customer->vatNo = $customerArray['vat_no'] ?? null;
$customer->customerNo = $data['customer_no'] ?? null;
$customer->name = $data['name'] ?? null;
$customer->notes = $data['notes'] ?? null;
$customer->orgNo = $data['org_no'] ?? null;
$customer->vatNo = $data['vat_no'] ?? null;
$customer->createdAt = isset($data['created_at']) ? new \DateTime($data['created_at']) : null;
$customer->updatedAt = $customerArray['updated_at'] ?? null;
$customer->companyType = $customerArray['company_type'] ?? null;
$customer->updatedAt = $data['updated_at'] ?? null;
$customer->companyType = $data['company_type'] ?? null;
return $customer;
}

0 comments on commit 80ce343

Please sign in to comment.