1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @author Rafał Muszyński <[email protected]> |
5
|
|
|
* @copyright 2013 Sourcefabric o.p.s. |
6
|
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.txt |
7
|
|
|
*/ |
8
|
|
|
namespace Newscoop\PaywallBundle\Entity; |
9
|
|
|
|
10
|
|
|
use Doctrine\ORM\Mapping as ORM; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Gateway entity. |
14
|
|
|
* |
15
|
|
|
* @ORM\Entity(repositoryClass="Newscoop\PaywallBundle\Entity\Repository\GatewayRepository") |
16
|
|
|
* @ORM\Table(name="plugin_paywall_gateways") |
17
|
|
|
*/ |
18
|
|
|
class Gateway |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @ORM\Id() |
22
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
23
|
|
|
* @ORM\Column(type="integer", name="id") |
24
|
|
|
* |
25
|
|
|
* @var int |
26
|
|
|
*/ |
27
|
|
|
protected $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @ORM\Column(type="string", name="name") |
31
|
|
|
* |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
protected $name; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @ORM\Column(type="text", name="value") |
38
|
|
|
* |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
protected $value; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @ORM\Column(type="datetime", name="created_at") |
45
|
|
|
* |
46
|
|
|
* @var \DateTime |
47
|
|
|
*/ |
48
|
|
|
protected $createdAt; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @ORM\Column(type="boolean", name="is_active") |
52
|
|
|
* |
53
|
|
|
* @var bool |
54
|
|
|
*/ |
55
|
|
|
protected $isActive = true; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Construct. |
59
|
|
|
*/ |
60
|
|
|
public function __construct() |
61
|
|
|
{ |
62
|
|
|
$this->createdAt = new \DateTime(); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Get id. |
67
|
|
|
* |
68
|
|
|
* @return int |
69
|
|
|
*/ |
70
|
|
|
public function getId() |
71
|
|
|
{ |
72
|
|
|
return $this->id; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Get name. |
77
|
|
|
* |
78
|
|
|
* @return string |
79
|
|
|
*/ |
80
|
|
|
public function getName() |
81
|
|
|
{ |
82
|
|
|
return $this->name; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Set name. |
87
|
|
|
* |
88
|
|
|
* @param string $name |
89
|
|
|
* |
90
|
|
|
* @return string |
91
|
|
|
*/ |
92
|
|
|
public function setName($name) |
93
|
|
|
{ |
94
|
|
|
$this->name = $name; |
95
|
|
|
|
96
|
|
|
return $name; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Get value. |
101
|
|
|
* |
102
|
|
|
* @return string |
103
|
|
|
*/ |
104
|
|
|
public function getValue() |
105
|
|
|
{ |
106
|
|
|
return $this->value; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Set value. |
111
|
|
|
* |
112
|
|
|
* @param string $value |
113
|
|
|
* |
114
|
|
|
* @return string |
115
|
|
|
*/ |
116
|
|
|
public function setValue($value) |
117
|
|
|
{ |
118
|
|
|
$this->value = $value; |
119
|
|
|
|
120
|
|
|
return $this; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Get status. |
125
|
|
|
* |
126
|
|
|
* @return bool |
127
|
|
|
*/ |
128
|
|
|
public function isActive() |
129
|
|
|
{ |
130
|
|
|
return $this->isActive; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* Set status. |
135
|
|
|
* |
136
|
|
|
* @param bool $isActive |
137
|
|
|
*/ |
138
|
|
|
public function setActive($isActive) |
139
|
|
|
{ |
140
|
|
|
$this->isActive = $isActive; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Get creation date. |
145
|
|
|
* |
146
|
|
|
* @return \DateTime |
147
|
|
|
*/ |
148
|
|
|
public function getCreatedAt() |
149
|
|
|
{ |
150
|
|
|
return $this->createdAt; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* Set creation date. |
155
|
|
|
* |
156
|
|
|
* @param \DateTime $createdAt |
157
|
|
|
*/ |
158
|
|
|
public function setCreatedAt(\DateTime $createdAt) |
159
|
|
|
{ |
160
|
|
|
$this->createdAt = $createdAt; |
161
|
|
|
} |
162
|
|
|
} |
163
|
|
|
|