Main::hookRouteList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
/**
4
 * @package Extractor
5
 * @author Iurii Makukh <[email protected]>
6
 * @copyright Copyright (c) 2015, Iurii Makukh
7
 * @license https://www.gnu.org/licenses/gpl.html GNU/GPLv3
8
 */
9
10
namespace gplcart\modules\extractor;
11
12
/**
13
 * Main class for Extractor module
14
 */
15
class Main
16
{
17
18
    /**
19
     * Implements hook "route.list"
20
     * @param array $routes
21
     */
22
    public function hookRouteList(array &$routes)
23
    {
24
        $routes['admin/tool/extract'] = array(
25
            'access' => 'module_extractor_edit',
26
            'menu' => array(
27
                'admin' => 'Extractor' // @text
28
            ),
29
            'handlers' => array(
30
                'controller' => array('gplcart\\modules\\extractor\\controllers\\Extractor', 'editExtractor')
31
            )
32
        );
33
    }
34
35
    /**
36
     * Implements hook "user.role.permissions"
37
     * @param array $permissions
38
     */
39
    public function hookUserRolePermissions(array &$permissions)
40
    {
41
        $permissions['module_extractor_edit'] = 'Extractor: edit'; // @text
42
    }
43
44
    /**
45
     * Implements hook "job.handlers"
46
     * @param array $handlers
47
     */
48
    public function hookJobHandlers(array &$handlers)
49
    {
50
        $handlers['extract'] = array(
51
            'handlers' => array(
52
                'process' => array('gplcart\\modules\\extractor\\handlers\\Extractor', 'process')
53
            ),
54
        );
55
    }
56
57
}
58