84 lines
1.4 KiB
PHP
84 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Label settings.
|
|
*
|
|
* @package WooCommerce DPD
|
|
*/
|
|
|
|
/**
|
|
* Can handle label settings.
|
|
*/
|
|
class WPDesk_WooCommerce_DPD_Label_Settings {
|
|
|
|
const A4_MULTIPLE = 'A4_MULTIPLE';
|
|
const A4 = 'A4';
|
|
const LBL_PRINTER = 'LBL_PRINTER';
|
|
|
|
const BIC3 = 'BIC3';
|
|
const BIC3_EXTENDED1 = 'BIC3_EXTENDED1';
|
|
|
|
const PDF = 'PDF';
|
|
const ZPL = 'ZPL';
|
|
const EPL = 'EPL';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $label_format;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $label_page_format;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $label_type;
|
|
|
|
/**
|
|
* WPDesk_WooCommerce_DPD_Label_Settings constructor.
|
|
*
|
|
* @param string $label_format .
|
|
* @param string $label_page_format .
|
|
* @param string $label_type .
|
|
*/
|
|
public function __construct( $label_format, $label_page_format, $label_type ) {
|
|
$this->label_format = $label_format;
|
|
$this->label_page_format = $label_page_format;
|
|
$this->label_type = $label_type;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function get_label_format() {
|
|
return $this->label_format;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function get_label_page_format() {
|
|
return $this->label_page_format;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function get_label_type() {
|
|
return $this->label_type;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function get_label_type_for_api() {
|
|
if ( $this->get_label_type() !== self::LBL_PRINTER ) {
|
|
return self::BIC3;
|
|
}
|
|
return $this->label_type;
|
|
}
|
|
|
|
}
|