protected function getPersonName(SubmissionEntity $submission) { $personName = new PersonName(); $detail = $submission->getDetail(); $FamilyName = $detail->getLastName(); $GivenName = $detail->getFirstName(); $personName->setFamilyName($FamilyName); $personName->setGivenName($GivenName); return $personName; }
protected function getPersonName(Lead $lead) { $personName = new PersonName(); $FirstName = $LastName = ""; foreach (['LastName', 'FirstName'] as $key) { ${$key} = $this->getLeadAttributeValue($lead, $key); } $personName->setFamilyName($LastName); $personName->setGivenName($FirstName); return $personName; }