Completed
Push — master ( c9546d...95f607 )
by Julito
09:41
created

ResetPasswordRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

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

3 Methods

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