# shiftcontroller/4.9.72/sh4/notifications/html/admin/users/controller/notifications.php

ShiftController Employee Shift Scheduling, version 4.9.72. 40 lines.

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

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

		HC3_Users_Query $usersQuery,
		HC3_Notificator $notificator
		)
	{
		$this->post = $hooks->wrap($post);

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

	public function executeOn( $userId )
	{
		$user = $this->usersQuery->findById( $userId );
		$this->notificator->setOnForUser( $user );
		$msg = '__Notifications Turned On__';

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

	public function executeOff( $userId )
	{
		$user = $this->usersQuery->findById( $userId );
		$this->notificator->setOffForUser( $user );
		$msg = '__Notifications Turned Off__';

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