1 | <?php |
||
15 | class Visit extends AbstractEntity implements \JsonSerializable |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | * @ORM\Column(type="string", length=256, nullable=true) |
||
20 | */ |
||
21 | protected $referer; |
||
22 | /** |
||
23 | * @var \DateTime |
||
24 | * @ORM\Column(type="datetime", nullable=false) |
||
25 | */ |
||
26 | protected $date; |
||
27 | /** |
||
28 | * @var string |
||
29 | * @ORM\Column(type="string", length=256, name="remote_addr", nullable=true) |
||
30 | */ |
||
31 | protected $remoteAddr; |
||
32 | /** |
||
33 | * @var string |
||
34 | * @ORM\Column(type="string", length=256, name="user_agent", nullable=true) |
||
35 | */ |
||
36 | protected $userAgent; |
||
37 | /** |
||
38 | * @var ShortUrl |
||
39 | * @ORM\ManyToOne(targetEntity=ShortUrl::class) |
||
40 | * @ORM\JoinColumn(name="short_url_id", referencedColumnName="id") |
||
41 | */ |
||
42 | protected $shortUrl; |
||
43 | /** |
||
44 | * @var VisitLocation |
||
45 | * @ORM\ManyToOne(targetEntity=VisitLocation::class, cascade={"persist"}) |
||
46 | * @ORM\JoinColumn(name="visit_location_id", referencedColumnName="id", nullable=true) |
||
47 | */ |
||
48 | protected $visitLocation; |
||
49 | |||
50 | 7 | public function __construct() |
|
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getReferer() |
||
62 | |||
63 | /** |
||
64 | * @param string $referer |
||
65 | * @return $this |
||
66 | */ |
||
67 | 3 | public function setReferer($referer) |
|
72 | |||
73 | /** |
||
74 | * @return \DateTime |
||
75 | */ |
||
76 | public function getDate() |
||
80 | |||
81 | /** |
||
82 | * @param \DateTime $date |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function setDate($date) |
||
90 | |||
91 | /** |
||
92 | * @return ShortUrl |
||
93 | */ |
||
94 | public function getShortUrl() |
||
98 | |||
99 | /** |
||
100 | * @param ShortUrl $shortUrl |
||
101 | * @return $this |
||
102 | */ |
||
103 | 2 | public function setShortUrl($shortUrl) |
|
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | 3 | public function getRemoteAddr() |
|
116 | |||
117 | /** |
||
118 | * @param string $remoteAddr |
||
119 | * @return $this |
||
120 | */ |
||
121 | 5 | public function setRemoteAddr($remoteAddr) |
|
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getUserAgent() |
||
134 | |||
135 | /** |
||
136 | * @param string $userAgent |
||
137 | * @return $this |
||
138 | */ |
||
139 | 3 | public function setUserAgent($userAgent) |
|
144 | |||
145 | /** |
||
146 | * @return VisitLocation |
||
147 | */ |
||
148 | public function getVisitLocation() |
||
152 | |||
153 | /** |
||
154 | * @param VisitLocation $visitLocation |
||
155 | * @return $this |
||
156 | */ |
||
157 | 2 | public function setVisitLocation($visitLocation) |
|
162 | |||
163 | /** |
||
164 | * Specify data which should be serialized to JSON |
||
165 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
166 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
167 | * which is a value of any type other than a resource. |
||
168 | * @since 5.4.0 |
||
169 | */ |
||
170 | 1 | public function jsonSerialize() |
|
180 | } |
||
181 |