BillingAddress.php
53 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Donations\Properties; |
| 4 | |
| 5 | final class BillingAddress |
| 6 | { |
| 7 | /** |
| 8 | * @var string |
| 9 | */ |
| 10 | public $country; |
| 11 | /** |
| 12 | * @var string |
| 13 | */ |
| 14 | public $address1; |
| 15 | /** |
| 16 | * @var string |
| 17 | */ |
| 18 | public $address2; |
| 19 | /** |
| 20 | * @var string |
| 21 | */ |
| 22 | public $city; |
| 23 | /** |
| 24 | * @var string |
| 25 | */ |
| 26 | public $state; |
| 27 | /** |
| 28 | * @var string |
| 29 | */ |
| 30 | public $zip; |
| 31 | |
| 32 | /** |
| 33 | * @since 2.19.6 |
| 34 | * |
| 35 | * @param array $array |
| 36 | * |
| 37 | * @return BillingAddress |
| 38 | */ |
| 39 | public static function fromArray($array) |
| 40 | { |
| 41 | $self = new static(); |
| 42 | |
| 43 | $self->country = $array['country']; |
| 44 | $self->address1 = $array['address1']; |
| 45 | $self->address2 = $array['address2']; |
| 46 | $self->city = $array['city']; |
| 47 | $self->state = $array['state']; |
| 48 | $self->zip = $array['zip']; |
| 49 | |
| 50 | return $self; |
| 51 | } |
| 52 | } |
| 53 |