<?php

namespace DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ProductFields\Value;

use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ProductFields\ProductFieldStringValue;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ProductFields\ProductFieldValue;
use WC_Product;
class GmcConditionProductFieldValue implements ProductFieldValue, ProductFieldStringValue
{
    public const FILTER_VALUE = 'wpdesk_dropshipping_export_mapper_condition';
    public const KEY = 'condition';
    private ?string $value = null;
    private WC_Product $product;
    public function __construct(WC_Product $product)
    {
        $this->product = $product;
    }
    public static function get_key(): string
    {
        return self::KEY;
    }
    public static function get_name(): string
    {
        return esc_attr__('Condition', 'dropshipping-export-free');
    }
    public function has_string_value(): bool
    {
        return \is_string($this->get_string_value());
    }
    public function get_string_value(): ?string
    {
        if ($this->value !== null) {
            return $this->value;
        }
        $this->value = \apply_filters(self::FILTER_VALUE, 'new', $this->product);
        return $this->value;
    }
}
