<?php

declare(strict_types=1);

namespace KupShop\GraphQLBundle\ApiPublic\Types\Product;

use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Annotations\Type;

/**
 * @Type()
 */
class ProductFavorite
{
    private $productFavorite;

    public function __construct(\Product $productFavorite)
    {
        $this->productFavorite = $productFavorite;
    }

    /**
     * @Field()
     */
    public function getProductId(): int
    {
        return (int) $this->productFavorite->id;
    }

    /**
     * @Field()
     */
    public function getProductTitle(): string
    {
        return $this->productFavorite->title;
    }
}
