Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | class Workflow extends base\Workflow implements Contract |
||
14 | { |
||
15 | use ContractTrait { |
||
16 | getLinks as getContractLinks; |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * @inheritdoc |
||
21 | */ |
||
22 | protected $stageClass = Stage::class; |
||
23 | |||
24 | /** |
||
25 | * @inheritdoc |
||
26 | */ |
||
27 | 19 | protected function slugBehaviorConfig(): array |
|
28 | { |
||
29 | return [ |
||
30 | 19 | 'resourceName' => 'workflow', |
|
31 | 19 | 'checkAccess' => function ($params) { |
|
32 | if ( |
||
33 | 19 | isset($params['workflow_id']) |
|
34 | 19 | && $this->id != $params['workflow_id'] |
|
35 | ) { |
||
36 | 4 | throw new NotFoundHttpException( |
|
37 | 4 | 'Workflow not associated to element.' |
|
38 | ); |
||
39 | } |
||
40 | 19 | }, |
|
41 | ]; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | 5 | public function getLinks() |
|
51 | ]); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 5 | public function extraFields() |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | 3 | public function getStages(): SoftDeleteActiveQuery |
|
70 |