|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace Yoti\DocScan\Session\Create; |
| 6 | + |
| 7 | +use JsonSerializable; |
| 8 | +use stdClass; |
| 9 | +use Yoti\Util\Json; |
| 10 | + |
| 11 | +class ApplicantProfile implements JsonSerializable |
| 12 | +{ |
| 13 | + /** |
| 14 | + * @var string|null |
| 15 | + */ |
| 16 | + private $fullName; |
| 17 | + |
| 18 | + /** |
| 19 | + * @var string|null |
| 20 | + */ |
| 21 | + private $dateOfBirth; |
| 22 | + |
| 23 | + /** |
| 24 | + * @var string|null |
| 25 | + */ |
| 26 | + private $namePrefix; |
| 27 | + |
| 28 | + /** |
| 29 | + * @var StructuredPostalAddress|null |
| 30 | + */ |
| 31 | + private $structuredPostalAddress; |
| 32 | + |
| 33 | + /** |
| 34 | + * @param string|null $fullName |
| 35 | + * @param string|null $dateOfBirth |
| 36 | + * @param string|null $namePrefix |
| 37 | + * @param StructuredPostalAddress|null $structuredPostalAddress |
| 38 | + */ |
| 39 | + public function __construct( |
| 40 | + ?string $fullName, |
| 41 | + ?string $dateOfBirth, |
| 42 | + ?string $namePrefix, |
| 43 | + ?StructuredPostalAddress $structuredPostalAddress |
| 44 | + ) { |
| 45 | + $this->fullName = $fullName; |
| 46 | + $this->dateOfBirth = $dateOfBirth; |
| 47 | + $this->namePrefix = $namePrefix; |
| 48 | + $this->structuredPostalAddress = $structuredPostalAddress; |
| 49 | + } |
| 50 | + |
| 51 | + /** |
| 52 | + * @return stdClass |
| 53 | + */ |
| 54 | + public function jsonSerialize(): stdClass |
| 55 | + { |
| 56 | + return (object) Json::withoutNullValues([ |
| 57 | + 'full_name' => $this->fullName, |
| 58 | + 'date_of_birth' => $this->dateOfBirth, |
| 59 | + 'name_prefix' => $this->namePrefix, |
| 60 | + 'structured_postal_address' => $this->structuredPostalAddress, |
| 61 | + ]); |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * @return string|null |
| 66 | + */ |
| 67 | + public function getFullName(): ?string |
| 68 | + { |
| 69 | + return $this->fullName; |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * @return string|null |
| 74 | + */ |
| 75 | + public function getDateOfBirth(): ?string |
| 76 | + { |
| 77 | + return $this->dateOfBirth; |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * @return string|null |
| 82 | + */ |
| 83 | + public function getNamePrefix(): ?string |
| 84 | + { |
| 85 | + return $this->namePrefix; |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * @return StructuredPostalAddress|null |
| 90 | + */ |
| 91 | + public function getStructuredPostalAddress(): ?StructuredPostalAddress |
| 92 | + { |
| 93 | + return $this->structuredPostalAddress; |
| 94 | + } |
| 95 | +} |
0 commit comments