This repository was archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSubscription.php
More file actions
74 lines (62 loc) · 1.39 KB
/
Subscription.php
File metadata and controls
74 lines (62 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
namespace Problematic\AuthNetBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Problematic\AuthNetBundle\Model\Subscription as BaseSubscription;
/**
* @ORM\MappedSuperclass
* @ORM\HasLifecycleCallbacks
*/
abstract class Subscription extends BaseSubscription
{
/**
* @ORM\Column(type="datetime")
*/
protected $created_at;
/**
* @ORM\Column(type="datetime")
*/
protected $updated_at;
/**
* @ORM\Column(type="integer", length="13")
*/
protected $subscription_id;
/**
* @ORM\Column(type="string")
*/
protected $status;
public function setCreatedAt(\DateTime $created_at)
{
$this->created_at = $created_at;
}
public function getCreatedAt()
{
return $this->created_at;
}
public function setUpdatedAt(\DateTime $updated_at)
{
$this->updated_at = $updated_at;
}
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* @ORM\PrePersist
*/
public function onPrePersist()
{
$this->setCreatedAt(new \DateTime());
$this->setUpdatedAt(new \DateTime());
}
/**
* @ORM\PreUpdate
*/
public function onPreUpdate()
{
$this->setUpdatedAt(new \DateTime());
}
public function __toString()
{
return $this->getSubscriptionId();
}
}