Completed
Push — master ( 2700b4...4ccb05 )
by Torben
04:03 queued 02:37
created

EditRecordViewHelper::initializeArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace DERHANSEN\SfEventMgt\ViewHelpers\Be;
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
 * ViewHelper for a backend link that should edit the given event UID
13
 *
14
 * @author Torben Hansen <[email protected]>
15
 */
16
class EditRecordViewHelper extends AbstractRecordViewHelper
17
{
18
    /**
19
     * Initialize arguments
20
     */
21
    public function initializeArguments()
22
    {
23
        parent::initializeArguments();
24
        $this->registerArgument('uid', 'integer', 'Record UID', true);
25
    }
26
27
    /**
28
     * Renders a edit link for the given Event UID
29
     *
30
     * @return string
31
     */
32
    public function render()
33
    {
34
        $uid = $this->arguments['uid'];
35
        $parameters = [
36
            'edit[tx_sfeventmgt_domain_model_event][' . (int)$uid . ']' => 'edit',
37
            'returnUrl' => $this->getReturnUrl(),
38
        ];
39
40
        return $this->getModuleUrl($parameters);
41
    }
42
}
43