WC_Shipping_Zone::__construct() public WC 1.0
Constructor for zones.
{} Это метод класса: WC_Shipping_Zone{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$WC_Shipping_Zone = new WC_Shipping_Zone(); $WC_Shipping_Zone->__construct( $zone );
- $zone(число/объект)
- Zone ID to load from the DB or zone object.
Код WC_Shipping_Zone::__construct() WC Shipping Zone:: construct WC 5.0.0
public function __construct( $zone = null ) {
if ( is_numeric( $zone ) && ! empty( $zone ) ) {
$this->set_id( $zone );
} elseif ( is_object( $zone ) ) {
$this->set_id( $zone->zone_id );
} elseif ( 0 === $zone || '0' === $zone ) {
$this->set_id( 0 );
} else {
$this->set_object_read( true );
}
$this->data_store = WC_Data_Store::load( 'shipping-zone' );
if ( false === $this->get_object_read() ) {
$this->data_store->read( $this );
}
}