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