| 1 | <?php |
||
| 8 | final class GivenName implements Serializable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private $givenName; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param string $givenName |
||
| 17 | */ |
||
| 18 | public function __construct($givenName) |
||
| 19 | { |
||
| 20 | Assertion::nonEmptyString($givenName, 'givenName'); |
||
| 21 | |||
| 22 | $this->givenName = $givenName; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param GivenName $other |
||
| 27 | * @return bool |
||
| 28 | */ |
||
| 29 | public function equals(GivenName $other) |
||
| 30 | { |
||
| 31 | return $this->givenName === $other->givenName; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | public function getGivenName() |
||
| 38 | { |
||
| 39 | return $this->givenName; |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function deserialize($data) |
||
| 46 | |||
| 47 | public function serialize() |
||
| 51 | |||
| 52 | public function __toString() |
||
| 53 | { |
||
| 54 | return $this->givenName; |
||
| 56 | } |
||
| 57 |