<?php declare(strict_types=1);

namespace Shopware\Core\Content\Product\SalesChannel;

use Shopware\Core\Content\Product\ProductCollection;
use Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\System\SalesChannel\StoreApiResponse;

#[Package('inventory')]
class ProductListResponse extends StoreApiResponse
{
    /**
     * @var EntitySearchResult<ProductCollection>
     */
    protected $object;

    /**
     * @param EntitySearchResult<ProductCollection> $object
     */
    public function __construct(EntitySearchResult $object)
    {
        parent::__construct($object);
    }

    public function getProducts(): ProductCollection
    {
        return $this->object->getEntities();
    }
}
