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; } }