<?php

namespace App\Request\RestaurantType;

use App\Entity\Category;
use OpenApi\Annotations as OA;
use App\Traits\TranslatorTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;

/**
 * @OA\Schema(
 *      title="RequestListRestaurantType"
 * )
 */
class RequestListRestaurantType
{
    public function __construct(Request $request)
    {
        $this->setKey($request->get('key'));
    }

    /**
     * @Assert\NotBlank()
     * @Assert\Length(
     *      min = 1,
     *      max = 50
     * )
     * @OA\Property(type="string")
     * */
    private $key;

    /**
     * Get min = 1,
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Set min = 1,
     *
     * @return  self
     */
    public function setKey($key)
    {
        $this->key = $key;

        return $this;
    }
}
