| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
#[AllowDynamicProperties] |
| 3 |
class SH4_Employees_Html_Admin_Controller_Delete |
| 4 |
{ |
| 5 |
public function __construct( |
| 6 |
HC3_Hooks $hooks, |
| 7 |
HC3_Post $post, |
| 8 |
|
| 9 |
SH4_Employees_Command $command, |
| 10 |
SH4_Employees_Query $query |
| 11 |
) |
| 12 |
{ |
| 13 |
$this->post = $post; |
| 14 |
$this->command = $hooks->wrap($command); |
| 15 |
$this->query = $hooks->wrap($query); |
| 16 |
} |
| 17 |
|
| 18 |
public function execute( $id ) |
| 19 |
{ |
| 20 |
$model = $this->query->findById( $id ); |
| 21 |
$this->command->delete( $model ); |
| 22 |
|
| 23 |
$return = array( array('admin/employees', array('status' => 'archive')), '__Employee Deleted__' ); |
| 24 |
return $return; |
| 25 |
} |
| 26 |
} |