1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by Graham Owens ([email protected]) |
4
|
|
|
* Company: PartFire Ltd (www.partfire.co.uk) |
5
|
|
|
* Console: Discovery |
6
|
|
|
* |
7
|
|
|
* User: gra |
8
|
|
|
* Date: 20/01/17 |
9
|
|
|
* Time: 09:13 |
10
|
|
|
* Project: PartFire MangoPay Bundle |
11
|
|
|
* File: Hook.php |
12
|
|
|
* |
13
|
|
|
**/ |
14
|
|
|
|
15
|
|
|
namespace PartFire\MangoPayBundle\Entity; |
16
|
|
|
|
17
|
|
|
use Doctrine\ORM\Mapping as ORM; |
18
|
|
|
use Doctrine\ORM\Mapping\MappedSuperclass; |
19
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
20
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
21
|
|
|
use JMS\Serializer\Annotation\ExclusionPolicy; |
22
|
|
|
use JMS\Serializer\Annotation\Expose; |
23
|
|
|
use PartFire\CommonBundle\Entity\CommonBaseEntity; |
24
|
|
|
use PartFire\MangoPayBundle\MangoPayConstants; |
25
|
|
|
|
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @ORM\Entity |
29
|
|
|
* @ORM\Table(name="partfire_mango_hook", indexes={ |
30
|
|
|
* @ORM\Index(name="index_enabled", columns={"enabled", "deleted", "status"}) }) |
31
|
|
|
* @ORM\Entity(repositoryClass="PartFire\MangoPayBundle\Entity\Repository\HookRepository") |
32
|
|
|
* @ExclusionPolicy("all") |
33
|
|
|
*/ |
34
|
|
|
|
35
|
|
|
class Hook extends CommonBaseEntity |
36
|
|
|
{ |
37
|
|
|
/** |
38
|
|
|
* @ORM\Column(name="resource_id",type="string", length=255, nullable=false); |
39
|
|
|
* |
40
|
|
|
*/ |
41
|
|
|
|
42
|
|
|
private $resourceId; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @ORM\Column(name="date",type="string", length=255, nullable=false); |
46
|
|
|
* |
47
|
|
|
*/ |
48
|
|
|
|
49
|
|
|
private $date; |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @ORM\Column(name="event_type",type="string", length=255, nullable=false); |
54
|
|
|
* |
55
|
|
|
*/ |
56
|
|
|
|
57
|
|
|
private $eventType; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @ORM\Column(name="raw_hook_data",type="string", length=500, nullable=false); |
61
|
|
|
* |
62
|
|
|
*/ |
63
|
|
|
|
64
|
|
|
private $rawHookData; |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @ORM\Column(name="raw_dto_data",type="text", nullable=true); |
68
|
|
|
* |
69
|
|
|
*/ |
70
|
|
|
|
71
|
|
|
private $dto; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var string |
75
|
|
|
* |
76
|
|
|
* @ORM\Column(name="status", type="string", length=200, nullable=false) |
77
|
|
|
*/ |
78
|
|
|
protected $status; |
79
|
|
|
|
80
|
|
|
public function __construct() |
81
|
|
|
{ |
82
|
|
|
parent::__construct(); |
83
|
|
|
$this->status = MangoPayConstants::HOOK_NEW; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return mixed |
88
|
|
|
*/ |
89
|
|
|
public function getResourceId() |
90
|
|
|
{ |
91
|
|
|
return $this->resourceId; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param mixed $resourceId |
96
|
|
|
*/ |
97
|
|
|
public function setResourceId($resourceId) |
98
|
|
|
{ |
99
|
|
|
$this->resourceId = $resourceId; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return mixed |
104
|
|
|
*/ |
105
|
|
|
public function getDate() |
106
|
|
|
{ |
107
|
|
|
return $this->date; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param mixed $date |
112
|
|
|
*/ |
113
|
|
|
public function setDate($date) |
114
|
|
|
{ |
115
|
|
|
$this->date = $date; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @return mixed |
120
|
|
|
*/ |
121
|
|
|
public function getEventType() |
122
|
|
|
{ |
123
|
|
|
return $this->eventType; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @param mixed $eventType |
128
|
|
|
*/ |
129
|
|
|
public function setEventType($eventType) |
130
|
|
|
{ |
131
|
|
|
$this->eventType = $eventType; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @return mixed |
136
|
|
|
*/ |
137
|
|
|
public function getRawHookData() |
138
|
|
|
{ |
139
|
|
|
return $this->rawHookData; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @param mixed $rawHookData |
144
|
|
|
*/ |
145
|
|
|
public function setRawHookData($rawHookData) |
146
|
|
|
{ |
147
|
|
|
$this->rawHookData = $rawHookData; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @return string |
152
|
|
|
*/ |
153
|
|
|
public function getStatus(): string |
154
|
|
|
{ |
155
|
|
|
return $this->status; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @param string $status |
160
|
|
|
*/ |
161
|
|
|
public function setStatus(string $status) |
162
|
|
|
{ |
163
|
|
|
$this->status = $status; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @return mixed |
168
|
|
|
*/ |
169
|
|
|
public function getDto() |
170
|
|
|
{ |
171
|
|
|
return unserialize($this->dto); |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @param mixed $dto |
176
|
|
|
*/ |
177
|
|
|
public function setDto($dto) |
178
|
|
|
{ |
179
|
|
|
$this->dto = serialize($dto); |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
|
183
|
|
|
} |