Skip to content
Snippets Groups Projects
TokenResponse.php 527 B
Newer Older
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
<?php

namespace App\Service\Response\Classes;

i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
use App\Service\Dto\Classes\TokenDto;
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
use Symfony\Component\DependencyInjection\Attribute\AsAlias;
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
use Symfony\Component\Serializer\Annotation\Groups;

i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
#[AsAlias(id: 'response.token', public: true)]
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
class TokenResponse extends Response
{
    /**
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
     * @var TokenDto
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
     */
    #[Groups(["data"])]
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
    public TokenDto $data;
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed

i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
    public function setToken(string $token): void
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
    {
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
        $dto = new TokenDto();
        $dto->token = $token;
        $this->data = $dto;
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
    }
}