# shiftcontroller/4.9.69/sh4/notifications/html/user/controller/profile/notifications.php

ShiftController Employee Shift Scheduling, version 4.9.69. 37 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.69/code/sh4/notifications/html/user/controller/profile/notifications.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.69/raw/sh4/notifications/html/user/controller/profile/notifications.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.69/code/sh4/notifications/html/user/controller/profile/notifications.php#L10-L20`.

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

		HC3_Auth $auth,
		HC3_Notificator $notificator
		)
	{
		$this->post = $hooks->wrap($post);

		$this->auth = $hooks->wrap( $auth );
		$this->notificator = $hooks->wrap( $notificator );
	}

	public function execute()
	{
		$user = $this->auth->getCurrentUser();

		$turnoff = $this->post->get('turnoff');

		if( $turnoff ){
			$this->notificator->setOffForUser( $user );
			$msg = '__Notifications Turned Off__';
		}
		else {
			$this->notificator->setOnForUser( $user );
			$msg = '__Notifications Turned On__';
		}

		$return = array( 'user/profile', $msg );
		return $return;
	}
}
```
