Completed
Push — development ( 6b83c1...4f1043 )
by Torben
11:42
created

RealUrlAutoConfiguration::addSfEventConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 37

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 9.328
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace DERHANSEN\SfEventMgt\Hooks;
3
4
/*
5
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.txt file that was distributed with this source code.
9
 */
10
11
/**
12
 * Realurl automatic configuration
13
 */
14
class RealUrlAutoConfiguration
15
{
16
    /**
17
     * Generates additional RealURL configuration and merges it with provided configuration
18
     *
19
     * @param array $params Default configuration
20
     * @return array Updated configuration
21
     */
22
    public function addSfEventConfig($params)
23
    {
24
        return array_merge_recursive(
25
            $params['config'],
26
            [
27
                'postVarSets' => [
28
                    '_DEFAULT' => [
29
                        'events' => [
30
                            [
31
                                'GETvar' => 'tx_sfeventmgt_pievent[controller]',
32
                                'noMatch' => 'bypass',
33
                            ],
34
                            [
35
                                'GETvar' => 'tx_sfeventmgt_pievent[action]',
36
                                'valueMap' => [
37
                                    'detail' => 'detail'
38
                                ]
39
                            ],
40
                            [
41
                                'GETvar' => 'tx_sfeventmgt_pievent[event]',
42
                                'lookUpTable' => [
43
                                    'table' => 'tx_sfeventmgt_domain_model_event',
44
                                    'id_field' => 'uid',
45
                                    'alias_field' => 'title',
46
                                    'useUniqueCache' => 1,
47
                                    'useUniqueCache_conf' => [
48
                                        'strtolower' => 1,
49
                                        'spaceCharacter' => '-',
50
                                    ],
51
                                ],
52
                            ],
53
                        ],
54
                    ]
55
                ]
56
            ]
57
        );
58
    }
59
}
60