Completed
Push — master ( e03e8c...cb9fdc )
by Iurii
02:46
created

Main::hookRouteList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
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('admin' => /* @text */'Extractor'),
27
            'handlers' => array(
28
                'controller' => array('gplcart\\modules\\extractor\\controllers\\Extractor', 'editExtractor')
29
            )
30
        );
31
    }
32
33
    /**
34
     * Implements hook "user.role.permissions"
35
     * @param array $permissions
36
     */
37
    public function hookUserRolePermissions(array &$permissions)
38
    {
39
        $permissions['module_extractor_edit'] = /* @text */'Extractor: edit';
40
    }
41
42
    /**
43
     * Implements hook "job.handlers"
44
     * @param array $handlers
45
     */
46
    public function hookJobHandlers(array &$handlers)
47
    {
48
        $handlers['extract'] = array(
49
            'handlers' => array(
50
                'process' => array('gplcart\\modules\\extractor\\handlers\\Extractor', 'process')
51
            ),
52
        );
53
    }
54
55
}
56