-
Notifications
You must be signed in to change notification settings - Fork 189
/
AbstractRule.php
111 lines (96 loc) · 2.37 KB
/
AbstractRule.php
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
namespace Kunstmaan\LeadGenerationBundle\Entity\Rule;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\LeadGenerationBundle\Entity\Popup\AbstractPopup;
use Kunstmaan\LeadGenerationBundle\Form\Rule\AbstractRuleAdminType;
use Kunstmaan\LeadGenerationBundle\Service\RuleServiceInterface;
/**
* @ORM\Entity
* @ORM\Table(name="kuma_popup_rules")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
*/
abstract class AbstractRule
{
/**
* @ORM\Id
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="\Kunstmaan\LeadGenerationBundle\Entity\Popup\AbstractPopup", inversedBy="rules")
* @ORM\JoinColumn(name="popup_id", referencedColumnName="id")
**/
protected $popup;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return AbstractPopup
*/
public function getPopup()
{
return $this->popup;
}
/**
* @return AbstractRule
*/
public function setPopup(AbstractPopup $popup)
{
$this->popup = $popup;
return $this;
}
/**
* @return string
*/
public function getFullClassname()
{
return \get_class($this);
}
/**
* @return string
*/
public function getClassname()
{
return basename(str_replace('\\', '/', \get_class($this)));
}
/**
* When the javascript code needs some properties that are not available in this entity, you can create a custom
* service that implements the RuleServiceInterface to append extra properties.
*
* @return RuleServiceInterface|null
*/
public function getService()
{
return null;
}
/**
* Get the javascript object class name.
*
* @return string
*/
abstract public function getJsObjectClass();
/**
* Get the properties that can be used in the javascript object.
*
* @return string
*/
abstract public function getJsProperties();
/**
* Get the file path of the javascript file that should be included.
*
* @return string
*/
abstract public function getJsFilePath();
/**
* Get the rule admin type
*
* @return AbstractRuleAdminType
*/
abstract public function getAdminType();
}