Completed
Pull Request — master (#30)
by
unknown
05:34
created

Event::getExpiredAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
7
use Symfony\Component\Serializer\Annotation\Groups;
8
9
/**
10
 * Event.
11
 *
12
 * @ORM\Table(name="event")
13
 * @ORM\Entity(repositoryClass="AppBundle\Repository\EventRepository")
14
 */
15
class Event implements \JsonSerializable
16
{
17
    use ORMBehaviors\Timestampable\Timestampable;
18
19
    /**
20
     * @var int
21
     *
22
     * @ORM\Column(name="id", type="integer")
23
     * @ORM\Id
24
     * @ORM\GeneratedValue(strategy="AUTO")
25
     */
26
    private $id;
27
28
    /**
29
     * @var string
30
     *
31
     * @ORM\Column(type="string", length=255)
32
     * @Groups({"Short"})
33
     */
34
    private $googleId;
35
36
    /**
37
     * @var \DateTime
38
     *
39
     * @ORM\Column(type="datetime")
40
     * @Groups({"Short"})
41
     */
42
    private $expiredAt;
43
44
    /**
45
     * @var
46
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="events", cascade={"persist"})
47
     */
48
    private $user;
49
50
    public function jsonSerialize()
51
    {
52
        return $this->getGoogleId();
53
    }
54
55
    /**
56
     * Get id.
57
     *
58
     * @return int
59
     */
60
    public function getId()
61
    {
62
        return $this->id;
63
    }
64
65
    /**
66
     * Set googleId.
67
     *
68
     * @param string $googleId
69
     *
70
     * @return Event
71
     */
72
    public function setGoogleId($googleId)
73
    {
74
        $this->googleId = $googleId;
75
76
        return $this;
77
    }
78
79
    /**
80
     * Get googleId.
81
     *
82
     * @return string
83
     */
84
    public function getGoogleId()
85
    {
86
        return $this->googleId;
87
    }
88
89
    /**
90
     * @return \DateTime
91
     */
92
    public function getExpiredAt()
93
    {
94
        return $this->expiredAt;
95
    }
96
97
    /**
98
     * @param \DateTime $expiredAt
99
     *
100
     * @return $this
101
     */
102
    public function setExpiredAt($expiredAt)
103
    {
104
        $this->expiredAt = $expiredAt;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Set user.
111
     *
112
     * @param User $user
113
     *
114
     * @return Event
115
     */
116
    public function setUser(User $user)
117
    {
118
        $this->user = $user;
119
120
        return $this;
121
    }
122
123
    /**
124
     * Get user.
125
     *
126
     * @return User
127
     */
128
    public function getUser()
129
    {
130
        return $this->user;
131
    }
132
}
133