1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Starkerxp\CampaignBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Starkerxp\StructureBundle\Entity\UserEntity; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Event |
10
|
|
|
* |
11
|
|
|
* @ORM\Table(name="campaign_event", indexes={ |
12
|
|
|
* @ORM\Index(columns={"created_at"}), |
13
|
|
|
* @ORM\Index(columns={"updated_at"}) |
14
|
|
|
* }) |
15
|
|
|
* @ORM\Entity(repositoryClass="Starkerxp\CampaignBundle\Repository\EventRepository") |
16
|
|
|
*/ |
17
|
|
|
class Event extends UserEntity |
18
|
|
|
{ |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var Campaign |
22
|
|
|
* |
23
|
|
|
* @ORM\ManyToOne(targetEntity="Campaign", cascade="persist", inversedBy="events") |
24
|
|
|
* @ORM\JoinColumn(name="campaign_id", referencedColumnName="id", nullable=false) |
25
|
|
|
*/ |
26
|
|
|
protected $campaign; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var Template |
30
|
|
|
* |
31
|
|
|
* @ORM\ManyToOne(targetEntity="Template", cascade="persist", inversedBy="events") |
32
|
|
|
* @ORM\JoinColumn(name="template_id", referencedColumnName="id", nullable=false) |
33
|
|
|
*/ |
34
|
|
|
protected $template; |
35
|
|
|
|
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Get campaign |
39
|
|
|
* |
40
|
|
|
* @return \Starkerxp\CampaignBundle\Entity\Campaign |
41
|
|
|
*/ |
42
|
|
|
public function getCampaign() |
43
|
|
|
{ |
44
|
|
|
return $this->campaign; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Set campaign |
49
|
|
|
* |
50
|
|
|
* @param \Starkerxp\CampaignBundle\Entity\Campaign $campaign |
51
|
|
|
* |
52
|
|
|
*/ |
53
|
|
|
public function setCampaign(\Starkerxp\CampaignBundle\Entity\Campaign $campaign) |
54
|
|
|
{ |
55
|
|
|
$this->campaign = $campaign; |
56
|
|
|
|
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Set template |
61
|
|
|
* |
62
|
|
|
* @param \Starkerxp\CampaignBundle\Entity\Template $template |
63
|
|
|
* |
64
|
|
|
* @return Event |
65
|
|
|
*/ |
66
|
|
|
public function setTemplate(\Starkerxp\CampaignBundle\Entity\Template $template) |
67
|
|
|
{ |
68
|
|
|
$this->template = $template; |
69
|
|
|
|
70
|
|
|
return $this; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Get template |
75
|
|
|
* |
76
|
|
|
* @return \Starkerxp\CampaignBundle\Entity\Template |
77
|
|
|
*/ |
78
|
|
|
public function getTemplate() |
79
|
|
|
{ |
80
|
|
|
return $this->template; |
81
|
|
|
} |
82
|
|
|
} |
|
|
|
|
83
|
|
|
|
This check marks files that end in a newline character, i.e. an empy line.