| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class Address |
| 4 |
* |
| 5 |
* @package Packetery\Module\EntityFactory |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace Packetery\Module\EntityFactory; |
| 11 |
|
| 12 |
use Packetery\Core\Entity; |
| 13 |
|
| 14 |
/** |
| 15 |
* Class Address |
| 16 |
* |
| 17 |
* @package Packetery\Module\EntityFactory |
| 18 |
*/ |
| 19 |
class Address { |
| 20 |
/** |
| 21 |
* Return WC store default address. |
| 22 |
* |
| 23 |
* @return Entity\Address |
| 24 |
*/ |
| 25 |
public function fromWcStoreOptions(): Entity\Address { |
| 26 |
$address = new Entity\Address( |
| 27 |
get_option( 'woocommerce_store_address', null ), |
| 28 |
get_option( 'woocommerce_store_city', null ), |
| 29 |
get_option( 'woocommerce_store_postcode', null ) |
| 30 |
); |
| 31 |
|
| 32 |
return $address; |
| 33 |
} |
| 34 |
} |
| 35 |
|