Completed
Push — develop ( 0d3736...607e7f )
by Nate
09:29
created

RegisterOrganizationUserElementActions   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 19
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 13 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/patron/license
6
 * @link       https://www.flipboxfactory.com/software/patron/
7
 */
8
9
namespace flipbox\organizations\events\handlers;
10
11
use Craft;
12
use craft\events\RegisterElementActionsEvent;
13
use flipbox\organizations\elements\actions\DissociateUsersFromOrganizationAction;
14
use flipbox\organizations\elements\actions\EditUserAssociation;
15
16
/**
17
 * @author Flipbox Factory <[email protected]>
18
 * @since 1.0.0
19
 */
20
class RegisterOrganizationUserElementActions
21
{
22
    /**
23
     * @param RegisterElementActionsEvent $event
24
     */
25
    public static function handle(RegisterElementActionsEvent $event)
26
    {
27
        $event->actions = [
28
            [
29
                'type' => DissociateUsersFromOrganizationAction::class,
30
                'organization' => Craft::$app->getRequest()->getParam('organization')
31
            ],
32
            [
33
                'type' => EditUserAssociation::class,
34
                'organization' => Craft::$app->getRequest()->getParam('organization')
35
            ],
36
        ];
37
    }
38
}
39