<?php

namespace KupShop\GraphQLBundle\ApiPublic\Types;

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

/**
 * @Type()
 */
class PublicPhoto
{
    protected $photo;

    public function __construct(array $photo)
    {
        $this->photo = $photo;
    }

    /**
     * @Field()
     */
    public function getId(): int
    {
        return (int) $this->photo['id'];
    }

    /**
     * @Field()
     */
    public function getDateUpdate(): int
    {
        return (int) $this->photo['date_update'];
    }

    /**
     * @Field()
     */
    public function getTitle(): string
    {
        return (string) $this->photo['title'];
    }

    #[Field]
    public function getSource(): string
    {
        return $this->photo['source'];
    }

    #[Field]
    public function getShowInLead(): string
    {
        return $this->photo['show_in_lead'];
    }
}
