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