<?php

declare(strict_types=1);

namespace Gls\GlsPoland\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gls\GlsPoland\Carrier\ParcelShopType;

/**
 * @ORM\Entity()
 */
class ShopDeliveryCarrier extends Carrier
{
    /**
     * @ORM\Column(name="parcelshop_type", type="string", length=16, nullable=true)
     */
    private $parcelShopType;

    public function getParcelShopType(): ?ParcelShopType
    {
        return ParcelShopType::tryFrom($this->parcelShopType);
    }

    public function setParcelShopType(?ParcelShopType $parcelShopType): self
    {
        $this->parcelShopType = null !== $parcelShopType ? $parcelShopType->getValue() : null;

        return $this;
    }
}
