1 | <?php |
||
13 | class Invitation implements \JsonSerializable |
||
14 | { |
||
15 | /** |
||
16 | * @ORM\ManyToOne(targetEntity="Game", cascade={"persist","remove"}) |
||
17 | * @ORM\JoinColumn(name="game_id", referencedColumnName="id", onDelete="CASCADE") |
||
18 | **/ |
||
19 | protected $game; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | * @ORM\Id |
||
24 | * @ORM\Column(name="request_key", type="string", length=32, nullable=false) |
||
25 | */ |
||
26 | protected $requestKey; |
||
27 | |||
28 | /** |
||
29 | * @ORM\ManyToOne(targetEntity="PlaygroundUser\Entity\User") |
||
30 | * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id") |
||
31 | **/ |
||
32 | protected $user; |
||
33 | |||
34 | /** |
||
35 | * @ORM\Column(name="created_at", type="datetime") |
||
36 | */ |
||
37 | protected $createdAt; |
||
38 | |||
39 | /** |
||
40 | * @ORM\Column(name="updated_at", type="datetime") |
||
41 | */ |
||
42 | protected $updatedAt; |
||
43 | |||
44 | /** |
||
45 | * @PrePersist |
||
46 | */ |
||
47 | public function createChrono() |
||
52 | |||
53 | /** |
||
54 | * @PreUpdate |
||
55 | */ |
||
56 | public function updateChrono() |
||
60 | |||
61 | public function setRequestKey($key) |
||
67 | |||
68 | public function getRequestKey() |
||
72 | |||
73 | public function setUser($user) |
||
79 | |||
80 | public function getUser() |
||
84 | |||
85 | /** |
||
86 | * @return the unknown_type |
||
87 | */ |
||
88 | public function getGame() |
||
92 | |||
93 | /** |
||
94 | * @param unknown_type $game |
||
95 | */ |
||
96 | public function setGame($game) |
||
102 | |||
103 | /** |
||
104 | * Convert the object to an array. |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | public function getArrayCopy() |
||
114 | |||
115 | /** |
||
116 | * Convert the object to json. |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | public function jsonSerialize() |
||
124 | } |
||
125 |