public function saveWithParams(Customer $customer = null, User $user, array $data) { if (!$customer) { $customer = new Customer(); $customer->setUser($user); } if (isset($data['name'])) { $customer->setName($data['name']); } if (isset($data['regNo'])) { $customer->setRegNo($data['regNo']); } if (isset($data['kmkrNo'])) { $customer->setKmkrNo($data['kmkrNo']); } if (isset($data['deadlineDays'])) { $customer->setDeadlineDays($data['deadlineDays']); } if (isset($data['delayPercent'])) { $customer->setDelayPercent($data['delayPercent']); } if (isset($data['address'])) { $customer->setAddress($data['address']); } if (isset($data['zip'])) { $customer->setZip($data['zip']); } if (isset($data['country'])) { $customer->setCountry($data['country']); } if (isset($data['city'])) { $customer->setCity($data['city']); } if (isset($data['url'])) { $customer->setUrl($data['url']); } if (isset($data['phone'])) { $customer->setPhone($data['phone']); } if (isset($data['email'])) { $customer->setEmail($data['email']); } if (isset($data['mob'])) { $customer->setMob($data['mob']); } $this->saveCustomer($customer); }