Code Duplication    Length = 19-19 lines in 2 locations

src/Admin/presenters/CompanyPresenter.php 2 locations

@@ 96-114 (lines=19) @@
93
        $this->template->numberOfCompanies = count($this->companies);
94
    }
95
96
    protected function createComponentActiveGrid($name)
97
    {
98
        $grid = $this->createGrid($this, $name, "\WebCMS\InvestformModule\Entity\Company", null, array(
99
            'active = true',
100
        ));
101
102
        $grid->setFilterRenderType(\Grido\Components\Filters\Filter::RENDER_INNER);
103
104
        $grid->addColumnText('name', 'Name')->setSortable();
105
106
        $grid->addColumnText('street', 'Street and number')->setSortable();
107
108
        $grid->addColumnText('zipCity', 'Zip and city')->setSortable();
109
110
        $grid->addActionHref("deactivate", 'Deactivate', 'deactivate', array('idPage' => $this->actualPage->getId()))->getElementPrototype()->addAttributes(array('class' => array('btn', 'btn-primary', 'ajax', 'grey')));
111
        $grid->addActionHref("detail", 'Company detail', 'detail', array('idPage' => $this->actualPage->getId()))->getElementPrototype()->addAttributes(array('class' => array('btn', 'btn-primary', 'green')));
112
113
        return $grid;
114
    }
115
116
    protected function createComponentInactiveGrid($name)
117
    {
@@ 116-134 (lines=19) @@
113
        return $grid;
114
    }
115
116
    protected function createComponentInactiveGrid($name)
117
    {
118
        $grid = $this->createGrid($this, $name, "\WebCMS\InvestformModule\Entity\Company", null, array(
119
            'active = false',
120
        ));
121
122
        $grid->setFilterRenderType(\Grido\Components\Filters\Filter::RENDER_INNER);
123
124
        $grid->addColumnText('name', 'Name')->setSortable();
125
126
        $grid->addColumnText('street', 'Street and number')->setSortable();
127
128
        $grid->addColumnText('zipCity', 'Zip and city')->setSortable();
129
130
        $grid->addActionHref("activate", 'Activate', 'activate', array('idPage' => $this->actualPage->getId()))->getElementPrototype()->addAttributes(array('class' => array('btn', 'btn-primary', 'ajax', 'grey')));
131
        $grid->addActionHref("detail", 'Company detail', 'detail', array('idPage' => $this->actualPage->getId()))->getElementPrototype()->addAttributes(array('class' => array('btn', 'btn-primary', 'green')));
132
133
        return $grid;
134
    }
135
136
    public function actionDeactivate($id, $idPage, $inDetail = false)
137
    {