1 | <?php |
||
15 | class Invitation implements \JsonSerializable |
||
16 | { |
||
17 | /** |
||
18 | * @ORM\ManyToOne(targetEntity="Game", cascade={"persist","remove"}) |
||
19 | * @ORM\JoinColumn(name="game_id", referencedColumnName="id", onDelete="CASCADE") |
||
20 | **/ |
||
21 | protected $game; |
||
22 | |||
23 | /** |
||
24 | * @ORM\Id |
||
25 | * @ORM\Column(type="integer"); |
||
26 | * @ORM\GeneratedValue(strategy="AUTO") |
||
27 | */ |
||
28 | protected $id; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | * @ORM\Column(name="request_key", type="string", length=255, nullable=false) |
||
33 | */ |
||
34 | protected $requestKey; |
||
35 | |||
36 | /** |
||
37 | * @ORM\ManyToOne(targetEntity="PlaygroundUser\Entity\User") |
||
38 | * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id") |
||
39 | **/ |
||
40 | protected $user; |
||
41 | |||
42 | /** |
||
43 | * The user who invite (it can be the system who's the host. This attribute will be null then) |
||
44 | * @ORM\ManyToOne(targetEntity="PlaygroundUser\Entity\User", cascade={"persist","remove"}) |
||
45 | * @ORM\JoinColumn(name="host_id", referencedColumnName="user_id", onDelete="CASCADE") |
||
46 | **/ |
||
47 | protected $host; |
||
48 | |||
49 | /** |
||
50 | * @ORM\Column(name="created_at", type="datetime") |
||
51 | */ |
||
52 | protected $createdAt; |
||
53 | |||
54 | /** |
||
55 | * @ORM\Column(name="updated_at", type="datetime") |
||
56 | */ |
||
57 | protected $updatedAt; |
||
58 | |||
59 | /** |
||
60 | * @PrePersist |
||
61 | */ |
||
62 | public function createChrono() |
||
67 | |||
68 | /** |
||
69 | * @PreUpdate |
||
70 | */ |
||
71 | public function updateChrono() |
||
75 | |||
76 | public function setId($id) |
||
82 | |||
83 | public function getId() |
||
87 | |||
88 | public function setRequestKey($key) |
||
94 | |||
95 | public function getRequestKey() |
||
99 | |||
100 | public function setUser($user) |
||
106 | |||
107 | public function getUser() |
||
111 | |||
112 | public function setHost($host) |
||
118 | |||
119 | public function getHost() |
||
123 | |||
124 | /** |
||
125 | * @return the unknown_type |
||
126 | */ |
||
127 | public function getGame() |
||
131 | |||
132 | /** |
||
133 | * @param unknown_type $game |
||
134 | */ |
||
135 | public function setGame($game) |
||
141 | |||
142 | /** |
||
143 | * Convert the object to an array. |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | public function getArrayCopy() |
||
153 | |||
154 | /** |
||
155 | * Convert the object to json. |
||
156 | * |
||
157 | * @return array |
||
158 | */ |
||
159 | public function jsonSerialize() |
||
163 | } |
||
164 |