# shiftcontroller/4.9.65/sh4/notifications/html/admin/controller/turnonoff.php

ShiftController Employee Shift Scheduling, version 4.9.65. 31 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.65/code/sh4/notifications/html/admin/controller/turnonoff.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.65/raw/sh4/notifications/html/admin/controller/turnonoff.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.65/code/sh4/notifications/html/admin/controller/turnonoff.php#L10-L20`.

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

	public function execute()
	{
		$isOff = $this->post->get('notifications_turnoff');
		if( $isOff ){
			$this->notificator->setOff();
		}
		else {
			$this->notificator->setOn();
		}

		$to = '-referrer-';
		$msg = NULL;
		$return = array( $to, $msg );

		return $return;
	}
}
```
