| 1 | <?php |
||
| 20 | trait ManageTrait |
||
| 21 | { |
||
| 22 | use CheckAccessTrait; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param mixed $data |
||
| 26 | * @return bool |
||
| 27 | */ |
||
| 28 | abstract protected function performAction($data): bool; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param $data |
||
| 32 | * @return mixed |
||
| 33 | * @throws \yii\web\HttpException |
||
| 34 | */ |
||
| 35 | protected function runInternal($data) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * HTTP success response code |
||
| 51 | * |
||
| 52 | * @return int |
||
| 53 | */ |
||
| 54 | protected function statusCodeSuccess(): int |
||
| 58 | |||
| 59 | /** |
||
| 60 | * HTTP fail response code |
||
| 61 | * |
||
| 62 | * @return int |
||
| 63 | */ |
||
| 64 | protected function statusCodeFail(): int |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param $data |
||
| 71 | * @return mixed |
||
| 72 | */ |
||
| 73 | protected function handleSuccessResponse($data) |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @param $data |
||
| 82 | * @return mixed |
||
| 83 | */ |
||
| 84 | protected function handleFailResponse($data) |
||
| 89 | } |
||
| 90 |