1
|
|
|
<?php |
2
|
|
|
namespace DERHANSEN\SfEventMgt\Controller; |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
* This file is part of the TYPO3 CMS project. |
6
|
|
|
* |
7
|
|
|
* It is free software; you can redistribute it and/or modify it under |
8
|
|
|
* the terms of the GNU General Public License, either version 2 |
9
|
|
|
* of the License, or any later version. |
10
|
|
|
* |
11
|
|
|
* For the full copyright and license information, please read the |
12
|
|
|
* LICENSE.txt file that was distributed with this source code. |
13
|
|
|
* |
14
|
|
|
* The TYPO3 project - inspiring people to share! |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
use DERHANSEN\SfEventMgt\Domain\Model\Dto\UserRegistrationDemand; |
18
|
|
|
use DERHANSEN\SfEventMgt\Utility\Page; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* UserRegistrationController |
22
|
|
|
* |
23
|
|
|
* @author Torben Hansen <[email protected]> |
24
|
|
|
*/ |
25
|
|
|
class UserRegistrationController extends AbstractController |
26
|
|
|
{ |
27
|
|
|
/** |
28
|
|
|
* Creates an user registration demand object with the given settings |
29
|
|
|
* |
30
|
|
|
* @param array $settings The settings |
31
|
|
|
* |
32
|
|
|
* @return \DERHANSEN\SfEventMgt\Domain\Model\Dto\UserRegistrationDemand |
33
|
|
|
*/ |
34
|
|
|
public function createUserRegistrationDemandObjectFromSettings(array $settings) |
35
|
|
|
{ |
36
|
|
|
/** @var \DERHANSEN\SfEventMgt\Domain\Model\Dto\UserRegistrationDemand $demand */ |
37
|
|
|
$demand = $this->objectManager->get(UserRegistrationDemand::class); |
38
|
|
|
$demand->setDisplayMode($settings['userRegistration']['displayMode']); |
39
|
|
|
$demand->setStoragePage(Page::extendPidListByChildren( |
40
|
|
|
$settings['userRegistration']['storagePage'], |
41
|
|
|
$settings['userRegistration']['recursive'] |
42
|
|
|
)); |
43
|
|
|
$demand->setOrderField($settings['userRegistration']['orderField']); |
44
|
|
|
$demand->setOrderDirection($settings['userRegistration']['orderDirection']); |
45
|
|
|
return $demand; |
46
|
|
|
} |
47
|
1 |
|
|
48
|
|
|
/** |
49
|
|
|
* Shows a list of all registration of the current frontend user |
50
|
1 |
|
* |
51
|
1 |
|
* @return void |
52
|
1 |
|
*/ |
53
|
1 |
|
public function listAction() |
54
|
1 |
|
{ |
55
|
1 |
|
$demand = $this->createUserRegistrationDemandObjectFromSettings($this->settings); |
56
|
1 |
|
$demand->setUser($this->registrationService->getCurrentFeUserObject()); |
|
|
|
|
57
|
1 |
|
$registrations = $this->registrationRepository->findRegistrationsByUserRegistrationDemand($demand); |
58
|
1 |
|
$this->view->assign('registrations', $registrations); |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: