| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | trait CanBeDeleted |
||
| 11 | { |
||
| 12 | use HandlesRequest, HasEntityIdName; |
||
| 13 | |||
| 14 | protected function requiresLoginForCanBeDelete() |
||
| 15 | { |
||
| 16 | return [ |
||
| 17 | 'delete', |
||
| 18 | ]; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Delete entity by ID. |
||
| 23 | * |
||
| 24 | * @param int $entityId |
||
| 25 | * |
||
| 26 | * @return bool |
||
| 27 | */ |
||
| 28 | public function delete($entityId) |
||
| 29 | { |
||
| 30 | return $this->post( |
||
|
|
|||
| 31 | $this->getDeleteUrl(), |
||
| 32 | [$this->getEntityIdName() => $entityId] |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | protected function getDeleteUrl() |
||
| 42 | } |
||
| 43 | } |
||
| 44 |