ContactInfoController::getCreateRenderTemplate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*************************************************************************************/
3
/*      This file is part of the Thelia package.                                     */
4
/*                                                                                   */
5
/*      Copyright (c) OpenStudio                                                     */
6
/*      email : [email protected]                                                       */
7
/*      web : http://www.thelia.net                                                  */
8
/*                                                                                   */
9
/*      For the full copyright and license information, please view the LICENSE.txt  */
10
/*      file that was distributed with this source code.                             */
11
/*************************************************************************************/
12
/*************************************************************************************/
13
14
namespace Dealer\Controller;
15
16
use Dealer\Controller\Base\BaseController;
17
use Dealer\Dealer;
18
use Symfony\Component\HttpFoundation\RedirectResponse;
19
use Thelia\Tools\URL;
20
21
/**
22
 * Class ContactInfoController
23
 * @package Dealer\Controller
24
 */
25
class ContactInfoController extends BaseController
26
{
27
    const CONTROLLER_ENTITY_NAME = "dealer-contact-info";
28
    const CONTROLLER_CHECK_RESOURCE = Dealer::RESOURCES_CONTACT;
29
    /**
30
     * Use to get render of list
31
     * @return mixed
32
     */
33
    protected function getListRenderTemplate()
34
    {
35
        $id = $this->getRequest()->request->get("dealer_id");
36
37
        return new RedirectResponse(URL::getInstance()->absoluteUrl("/admin/module/Dealer/dealer/edit",
38
            ["dealer_id" => $id, ]));
39
    }
40
41
    /**
42
     * Must return a RedirectResponse instance
43
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
44
     */
45
    protected function redirectToListTemplate()
46
    {
47
        $id = $this->getRequest()->request->get("dealer_id");
48
49
        return new RedirectResponse(URL::getInstance()->absoluteUrl("/admin/module/Dealer/dealer/edit",
50
            ["dealer_id" => $id, ]));
51
    }
52
53
    /**
54
     * Use to get Edit render
55
     * @return mixed
56
     */
57
    protected function getEditRenderTemplate()
58
    {
59
        return $this->render("dealer-edit");
60
    }
61
62
    /**
63
     * Use to get Create render
64
     * @return mixed
65
     */
66
    protected function getCreateRenderTemplate()
67
    {
68
        return $this->render("dealer-edit");
69
    }
70
71
    /**
72
     * @return mixed
73
     */
74
    protected function getObjectId($object)
75
    {
76
        $object->getId();
77
    }
78
79
    /**
80
     * Load an existing object from the database
81
     */
82
    protected function getExistingObject()
83
    {
84
        // TODO: Implement getExistingObject() method.
85
    }
86
87
    /**
88
     * Hydrate the update form for this object, before passing it to the update template
89
     *
90
     * @param mixed $object
91
     */
92
    protected function hydrateObjectForm($object)
93
    {
94
        // TODO: Implement hydrateObjectForm() method.
95
    }
96
97
    /**
98
     * Method to get current controller associated service
99
     * @return object
100
     */
101
    protected function getService()
102
    {
103
        if (!$this->service) {
104
            $this->service = $this->getContainer()->get("dealer_contact_info_service");
105
        }
106
107
        return $this->service;
108
    }
109
}
110