flexible-shipping
/
vendor_prefixed
/
wpdesk
/
wp-wpdesk-fs-table-rate
/
src
/
Settings
/
IntegrationSettingsImplementation.php
flexible-shipping
/
vendor_prefixed
/
wpdesk
/
wp-wpdesk-fs-table-rate
/
src
/
Settings
Last commit date
CartCalculationOptions.php
1 week ago
CheckboxValue.php
1 week ago
IntegrationSettings.php
1 week ago
IntegrationSettingsFactory.php
1 week ago
IntegrationSettingsImplementation.php
1 week ago
MethodSettings.php
1 week ago
MethodSettingsFactory.php
1 week ago
MethodSettingsImplementation.php
1 week ago
IntegrationSettingsImplementation.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Class IntegrationSettingsImplementation |
| 5 | * @package WPDesk\FS\TableRate\Settings |
| 6 | */ |
| 7 | namespace FSVendor\WPDesk\FS\TableRate\Settings; |
| 8 | |
| 9 | use FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog; |
| 10 | /** |
| 11 | * Integration settings implementation. |
| 12 | */ |
| 13 | class IntegrationSettingsImplementation implements IntegrationSettings, CanFormatForLog |
| 14 | { |
| 15 | /** |
| 16 | * @var string |
| 17 | */ |
| 18 | private $name; |
| 19 | /** |
| 20 | * IntegrationSettingsImplementation constructor. |
| 21 | * |
| 22 | * @param string $name |
| 23 | */ |
| 24 | public function __construct($name) |
| 25 | { |
| 26 | $this->name = $name; |
| 27 | } |
| 28 | /** |
| 29 | * @return string |
| 30 | */ |
| 31 | public function get_name() |
| 32 | { |
| 33 | return $this->name; |
| 34 | } |
| 35 | /** |
| 36 | * @return string |
| 37 | */ |
| 38 | public function format_for_log() |
| 39 | { |
| 40 | $integrations_options = apply_filters('flexible_shipping_integration_options', array('' => __('None', 'flexible-shipping'))); |
| 41 | return sprintf(__('Integration: %1$s', 'flexible-shipping'), isset($integrations_options[$this->name]) ? $integrations_options[$this->name] : $this->name) . "\n"; |
| 42 | } |
| 43 | } |
| 44 |