# shiftcontroller/4.9.85/sh4/calendars/html/admin/controller/edit.php

ShiftController Employee Shift Scheduling, version 4.9.85. 34 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/sh4/calendars/html/admin/controller/edit.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/raw/sh4/calendars/html/admin/controller/edit.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.85/code/sh4/calendars/html/admin/controller/edit.php#L10-L20`.

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

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

		$title = $this->post->get('title');
		$color = $this->post->get('color');
		$description = $this->post->get('description');
		$type = $this->post->get('calendar_type');

		$this->command->changeTitle( $model, $title );
		$this->command->changeColor( $model, $color );
		$this->command->changeDescription( $model, $description );
		$this->command->changeType( $model, $type );

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