Skip to content
Snippets Groups Projects
Facet.php 600 B
Newer Older
Pavel's avatar
Pavel committed
<?php

namespace IQDEV\Search\Facet;

Pavel's avatar
Pavel committed
use IQDEV\Search\Facet\Item\FacetItemCollection;
use IQDEV\Search\Facet\Type\FacetType;

Pavel's avatar
Pavel committed
final class Facet
{
Pavel's avatar
Pavel committed
    public FacetItemCollection $products;
Pavel's avatar
Pavel committed

Pavel's avatar
Pavel committed
    protected FacetType $type;

    protected string $code;
Pavel's avatar
Pavel committed

Pavel's avatar
Pavel committed
    public function __construct(FacetType $type, string $code)
Pavel's avatar
Pavel committed
    {
Pavel's avatar
Pavel committed
        $this->type = $type;
        $this->code = $code;
        $this->products = new FacetItemCollection();
Pavel's avatar
Pavel committed
    }

    public function getType(): FacetType
    {
        return $this->type;
    }

    public function getCode(): string
    {
        return $this->code;
    }