<?php

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

use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\ProductFields\ProductField;
use ArrayObject;
class ProductFieldCollection extends ArrayObject
{
    public function add_product_field(ProductField $product_field)
    {
        $this->offsetSet($product_field->get_field_name(), $product_field);
    }
    public function get_product_field(string $field_name): ProductField
    {
        return $this->offsetGet($field_name);
    }
    public function has_product_field(string $field_name): bool
    {
        return $this->offsetExists($field_name);
    }
    public function remove_product_field(string $field_name)
    {
        $this->offsetUnset($field_name);
    }
    public function get_product_fields(): array
    {
        return $this->getArrayCopy();
    }
}
