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