# shiftcontroller/4.9.66/sh4/calendars/html/admin/controller/delete.php

ShiftController Employee Shift Scheduling, version 4.9.66. 23 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/sh4/calendars/html/admin/controller/delete.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/raw/sh4/calendars/html/admin/controller/delete.php
- Modified: 2023-05-29T12:46:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/sh4/calendars/html/admin/controller/delete.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
#[AllowDynamicProperties]
class SH4_Calendars_Html_Admin_Controller_Delete
{
	public function __construct(
		HC3_Hooks $hooks,
		SH4_Calendars_Query $query,
		SH4_Calendars_Command $command
		)
	{
		$this->query = $hooks->wrap($query);
		$this->command = $hooks->wrap($command);
	}

	public function execute( $id )
	{
		$model = $this->query->findById( $id );
		$this->command->delete( $model );

		$return = array( 'admin/calendars', '__Calendar Deleted__' );
		return $return;
	}
}
```
