Completed
Push — master ( a0a31d...c5384e )
by Julito
24:45 queued 10:34
created

ResetPasswordRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 40
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getUser() 0 3 1
A __construct() 0 4 1
A setId() 0 5 1
A getId() 0 3 1
1
<?php
2
3
namespace Chamilo\CoreBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestInterface;
7
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestTrait;
8
9
/**
10
 * @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Repository\ResetPasswordRequestRepository")
11
 */
12
class ResetPasswordRequest implements ResetPasswordRequestInterface
13
{
14
    use ResetPasswordRequestTrait;
15
16
    /**
17
     * @ORM\Id()
18
     * @ORM\GeneratedValue()
19
     * @ORM\Column(type="integer")
20
     */
21
    private $id;
22
23
    /**
24
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
25
     */
26
    private $user;
27
28
    public function __construct(object $user, \DateTimeInterface $expiresAt, string $selector, string $hashedToken)
29
    {
30
        $this->user = $user;
31
        $this->initialize($expiresAt, $selector, $hashedToken);
32
    }
33
34
    public function getUser(): object
35
    {
36
        return $this->user;
37
    }
38
39
    public function getId()
40
    {
41
        return $this->id;
42
    }
43
44
    /**
45
     * @return ResetPasswordRequest
46
     */
47
    public function setId($id)
48
    {
49
        $this->id = $id;
50
51
        return $this;
52
    }
53
}
54