Completed
Push — master ( e219aa...e1fcb3 )
by Nate
06:24 queued 05:08
created

Associate::performAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/domains/license
6
 * @link       https://www.flipboxfactory.com/software/domains/
7
 */
8
9
namespace flipbox\domains\actions;
10
11
use flipbox\craft\sortable\associations\records\SortableAssociationInterface;
12
use flipbox\domains\Domains;
13
use yii\base\Model;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since  1.0.0
18
 */
19
class Associate extends Action
20
{
21
    /**
22
     * @param Model|SortableAssociationInterface $model
23
     * @return bool
24
     * @throws \Exception
25
     */
26
    protected function performAction(Model $model): bool
27
    {
28
        return Domains::getInstance()->getAssociations()->associate($model);
29
    }
30
}
31