1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Kunstmaan\LeadGenerationBundle\Controller; |
4
|
|
|
|
5
|
|
|
use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface; |
6
|
|
|
use Kunstmaan\AdminListBundle\Controller\AdminListController; |
7
|
|
|
use Kunstmaan\LeadGenerationBundle\AdminList\RulesAdminListConfigurator; |
8
|
|
|
use Symfony\Component\Routing\Annotation\Route; |
9
|
|
|
use Symfony\Component\HttpFoundation\Request; |
10
|
|
|
|
11
|
|
|
class RulesAdminListController extends AdminListController |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* @var RulesAdminListConfigurator |
15
|
|
|
*/ |
16
|
|
|
private $configurator; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @return AdminListConfiguratorInterface |
20
|
|
|
*/ |
21
|
|
|
public function getAdminListConfigurator($id) |
22
|
|
|
{ |
23
|
|
|
if (!isset($this->configurator)) { |
24
|
|
|
$this->configurator = new RulesAdminListConfigurator($this->getEntityManager(), null, $id); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
return $this->configurator; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* The detail action |
32
|
|
|
* |
33
|
|
|
* @Route("/{popup}/rules", requirements={"popup" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_detail") |
34
|
|
|
*/ |
35
|
|
|
public function detailAction(Request $request, $popup) |
36
|
|
|
{ |
37
|
|
|
return parent::doIndexAction($this->getAdminListConfigurator($popup), $request); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* The add action |
42
|
|
|
* |
43
|
|
|
* @Route("/{popup}/add", requirements={"popup" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_add", methods={"GET", "POST"}) |
44
|
|
|
* |
45
|
|
|
* @return array |
46
|
|
|
*/ |
47
|
|
|
public function addAction(Request $request, $popup) |
48
|
|
|
{ |
49
|
|
|
$type = $request->get('type'); |
50
|
|
|
|
51
|
|
|
return parent::doAddAction($this->getAdminListConfigurator($popup), $type, $request); |
|
|
|
|
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* The edit action |
56
|
|
|
* |
57
|
|
|
* @param int $id |
58
|
|
|
* |
59
|
|
|
* @Route("/{popup}/rules/{id}/edit", requirements={"popup" = "\d+", "rule" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_edit", methods={"GET", "POST"}) |
60
|
|
|
* |
61
|
|
|
* @return array |
62
|
|
|
*/ |
63
|
|
|
public function editAction(Request $request, $id, $popup) |
64
|
|
|
{ |
65
|
|
|
return parent::doEditAction($this->getAdminListConfigurator($popup), $id, $request); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* The delete action |
70
|
|
|
* |
71
|
|
|
* @param int $id |
72
|
|
|
* |
73
|
|
|
* @Route("/{popup}/rules/{id}/delete", requirements={"popup" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_delete", methods={"GET", "POST"}) |
74
|
|
|
* |
75
|
|
|
* @return array |
76
|
|
|
*/ |
77
|
|
|
public function deleteAction(Request $request, $id, $popup) |
78
|
|
|
{ |
79
|
|
|
return parent::doDeleteAction($this->getAdminListConfigurator($popup), $id, $request); |
80
|
|
|
} |
81
|
|
|
} |
82
|
|
|
|
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.