ResponseModel.php 983 Bytes
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1 2 3 4 5 6 7
<?php

namespace Source\UseCases\Users\Authenticate;

use Source\Entities\User;
use Source\Entities\Token;

Jacob Priddy's avatar
Jacob Priddy committed
8 9
class ResponseModel
{
Jacob Priddy's avatar
Jacob Priddy committed
10 11 12 13 14 15 16 17 18 19 20
    /**
     * @var User
     */
    protected User $user;

    /**
     * @var Token
     */
    protected Token $token;

    /**
21
     * @var string
Jacob Priddy's avatar
Jacob Priddy committed
22
     */
23 24 25 26 27 28 29 30
    protected string $tokenString;

    /**
     * @param User   $user
     * @param string $tokenString
     * @param Token  $token
     */
    public function __construct(User $user, string $tokenString, Token $token)
Jacob Priddy's avatar
Jacob Priddy committed
31
    {
Jacob Priddy's avatar
Jacob Priddy committed
32 33
        $this->user = $user;
        $this->token = $token;
34
        $this->tokenString = $tokenString;
Jacob Priddy's avatar
Jacob Priddy committed
35 36 37 38 39
    }

    /**
     * @return User
     */
Jacob Priddy's avatar
Jacob Priddy committed
40 41
    public function getUser(): User
    {
Jacob Priddy's avatar
Jacob Priddy committed
42 43 44 45 46 47
        return $this->user;
    }

    /**
     * @return Token
     */
Jacob Priddy's avatar
Jacob Priddy committed
48 49
    public function getToken(): Token
    {
Jacob Priddy's avatar
Jacob Priddy committed
50 51
        return $this->token;
    }
52 53 54 55 56 57 58 59

    /**
     * @return string
     */
    public function getRawToken(): string
    {
        return $this->tokenString;
    }
Jacob Priddy's avatar
Jacob Priddy committed
60
}