WC_Legacy_Shipping_Zone

Legacy Shipping Zone.

Defined (1)

The class is defined in the following location(s).

/includes/legacy/class-wc-legacy-shipping-zone.php  
  1. abstract class WC_Legacy_Shipping_Zone extends WC_Data { 
  2.  
  3. /** 
  4. * Get zone ID 
  5. * @return int|null Null if the zone does not exist. 0 is the default zone. 
  6. * @deprecated 3.0 
  7. */ 
  8. public function get_zone_id() { 
  9. wc_deprecated_function( 'WC_Shipping_Zone::get_zone_id', '3.0', 'WC_Shipping_Zone::get_id' ); 
  10. return $this->get_id(); 
  11.  
  12. /** 
  13. * Read a shipping zone by ID. 
  14. * @deprecated 3.0.0 - Init a shipping zone with an ID. 
  15. */ 
  16. public function read( $zone_id ) { 
  17. wc_deprecated_function( 'WC_Shipping_Zone::read', '3.0', 'a shipping zone initialized with an ID.' ); 
  18. $this->set_id( $zone_id ); 
  19. $data_store = WC_Data_Store::load( 'shipping-zone' ); 
  20. $data_store->read( $this ); 
  21.  
  22. /** 
  23. * Update a zone. 
  24. * @deprecated 3.0.0 - Use ::save instead. 
  25. */ 
  26. public function update() { 
  27. wc_deprecated_function( 'WC_Shipping_Zone::update', '3.0', 'WC_Shipping_Zone::save instead.' ); 
  28. $data_store = WC_Data_Store::load( 'shipping-zone' ); 
  29. try { 
  30. $data_store->update( $this ); 
  31. } catch ( Exception $e ) { 
  32. return false; 
  33.  
  34. /** 
  35. * Create a zone. 
  36. * @deprecated 3.0.0 - Use ::save instead. 
  37. */ 
  38. public function create() { 
  39. wc_deprecated_function( 'WC_Shipping_Zone::create', '3.0', 'WC_Shipping_Zone::save instead.' ); 
  40. $data_store = WC_Data_Store::load( 'shipping-zone' ); 
  41. try { 
  42. $data_store->create( $this ); 
  43. } catch ( Exception $e ) { 
  44. return false; 
  45.  
  46.