1 | <?php |
||
2 | |||
3 | namespace Lendable\GoCardlessEnterpriseBundle\Entity; |
||
4 | |||
5 | use Lendable\GoCardlessEnterpriseBundle\Enum\MandateState; |
||
6 | |||
7 | class Mandate extends \Lendable\GoCardlessEnterprise\Model\Mandate |
||
8 | { |
||
9 | /** |
||
10 | * @var \DateTimeInterface |
||
11 | */ |
||
12 | protected $updated; |
||
13 | |||
14 | /** |
||
15 | * @return \DateTimeInterface |
||
16 | */ |
||
17 | public function getUpdated() |
||
18 | { |
||
19 | return $this->updated; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param \DateTimeInterface $updated |
||
24 | */ |
||
25 | public function setUpdated(\DateTimeInterface $updated) |
||
26 | { |
||
27 | $this->updated = $updated; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $pdfPath; |
||
34 | |||
35 | /** |
||
36 | * @param string $path |
||
37 | */ |
||
38 | public function setPdfPath($path) |
||
39 | { |
||
40 | $this->pdfPath = $path; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | public function getPdfPath() |
||
47 | { |
||
48 | return $this->pdfPath; |
||
49 | } |
||
50 | |||
51 | public function toArray() |
||
52 | { |
||
53 | $arr = parent::toArray(); |
||
54 | if (array_key_exists('pdfPath', $arr)) { |
||
55 | unset($arr['pdfPath']); |
||
56 | } |
||
57 | |||
58 | return $arr; |
||
59 | } |
||
60 | |||
61 | public function fromArray($data) |
||
62 | { |
||
63 | parent::fromArray($data); |
||
64 | $this->setCreatedAt(new \DateTime($this->getCreatedAt())); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return bool |
||
69 | */ |
||
70 | public function isActive() |
||
71 | { |
||
72 | return in_array($this->getStatus(), MandateState::getActiveStates()); |
||
73 | } |
||
74 | } |
||
75 |