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