Skip to content

Commit 4d2d594

Browse files
committed
Saving citizenship country code
1 parent f4e5dec commit 4d2d594

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/LookupResult/CprLookupResult.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ class CprLookupResult {
156156
*/
157157
protected \DateTime $citizenshipDate;
158158

159+
/**
160+
* Citizenship country code.
161+
*
162+
* @var int
163+
*/
164+
protected $citizenshipCountryCode;
165+
159166
/**
160167
* Date of birth.
161168
*
@@ -485,6 +492,20 @@ public function setCitizenshipDate(\DateTime $citizenshipDate): void {
485492
$this->citizenshipDate = $citizenshipDate;
486493
}
487494

495+
/**
496+
* @return int
497+
*/
498+
public function getCitizenshipCountryCode(): int {
499+
return $this->citizenshipCountryCode;
500+
}
501+
502+
/**
503+
* @param int $citizenshipCountryCode
504+
*/
505+
public function setCitizenshipCountryCode(int $citizenshipCountryCode): void {
506+
$this->citizenshipCountryCode = $citizenshipCountryCode;
507+
}
508+
488509
/**
489510
* @return \DateTime
490511
*/

src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ public function lookup($cpr, $fetchChildren = TRUE, $allowCprTestModeReplace = T
140140
}
141141

142142
if ($persondata->statsborgerskab) {
143+
$cprResult->setCitizenshipCode($persondata->statsborgerskab->landekode);
144+
143145
if ($persondata->statsborgerskab->landekode == self::DENMARK_COUNTRY_CODE) {
144146
$cprResult->setCitizen(TRUE);
145147
}

0 commit comments

Comments
 (0)