# shiftcontroller/4.9.95/sh4/shifts/controller/calendar.php

ShiftController Employee Shift Scheduling, version 4.9.95. 35 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.95/code/sh4/shifts/controller/calendar.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.95/raw/sh4/shifts/controller/calendar.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.95/code/sh4/shifts/controller/calendar.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
#[AllowDynamicProperties]
class SH4_Shifts_Controller_Calendar
{
	public function __construct(
		HC3_Hooks $hooks,
		HC3_Post $post,

		SH4_Shifts_Query $query,
		SH4_Shifts_Command $command,
		SH4_Calendars_Query $calendars
		)
	{
		$this->post = $post;

		$this->query = $hooks->wrap($query);
		$this->command = $hooks->wrap($command);
		$this->calendars = $hooks->wrap($calendars);
	}

	public function execute( $id, $calendarId )
	{
		$calendar = $this->calendars->findById( $calendarId );

		$shift = $this->query->findById( $id );
		$this->command->changeCalendar( $shift, $calendar );

		$to = 'schedule';

		$msg = '__Calendar Changed__';

		$return = array( $to, $msg );
		return $return;
	}
}
```
