Passed
Push — master ( 9c95d4...eee053 )
by Joe Nilson
03:19
created

EditNCFTipoMovimiento::execAfterAction()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 13
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 17
rs 9.8333
1
<?php
2
3
/*
4
 * Copyright (C) 2019 joenilson.
5
 *
6
 * This library is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 3 of the License, or (at your option) any later version.
10
 *
11
 * This library is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA 02110-1301  USA
20
 */
21
22
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Controller;
23
24
use FacturaScripts\Core\Lib\ExtendedController\EditController;
1 ignored issue
show
Bug introduced by
The type FacturaScripts\Core\Lib\...ntroller\EditController was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFTipoMovimiento;
26
27
/**
28
 * Description of EditNCFTipoMovimiento
29
 *
30
 * @author joenilson
31
 */
32
class EditNCFTipoMovimiento extends EditController
33
{
34
    public function getModelClassName()
35
    {
36
        return 'NCFTipoMovimiento';
37
    }
38
    
39
    public function getPageData()
40
    {
41
        $pagedata = parent::getPageData();
42
        $pagedata['menu'] = 'RepublicaDominicana';
43
        $pagedata['title'] = 'edit-ncf-movement-type';
44
        $pagedata['icon'] = 'fas fa-tasks';
45
46
        return $pagedata;
47
    }
48
49
    public function execAfterAction($action)
50
    {
51
        switch ($action) {
52
            case 'busca_movimiento':
53
                $this->setTemplate(FALSE);
54
                $tipomovimiento = new NCFTipoMovimiento();
55
                $where = [new DatabaseWhere('tipomovimiento', $_REQUEST['tipomovimiento'])];
0 ignored issues
show
Bug introduced by
The type FacturaScripts\Plugins\f...ontroller\DatabaseWhere was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
56
                $movimientos = $tipomovimiento->all($where);
57
                if ($movimientos) {
58
                    //header('Content-Type: application/json');
59
                    echo json_encode(['movimientos' => $movimientos]);
60
                } else {
61
                    echo '';
62
                }
63
                break;
64
            default:
65
                break;
66
        }
67
    }
68
69
}
70