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