.

MarkreadNotificationsCommand Class Reference

Mark notification as read. More...

Inheritance diagram for MarkreadNotificationsCommand:
CommandChain CommandBase ICommand IAction ISerializable

List of all members.

Public Member Functions

  get_description ()
  Returns a description of this command.
  get_name ()
  Returns title of command.

Protected Member Functions

  do_execute ()
  Do it.

Detailed Description

Mark notification as read.

Definition at line 5 of file markread.cmd.php.


Member Function Documentation

MarkreadNotificationsCommand::do_execute (  )  [protected]

Do it.

See also:
core/behaviour/base/CommandTransactionaldo_execute()

Reimplemented from CommandChain.

Definition at line 25 of file markread.cmd.php.

00025                                         {
00026                 $ret = new Status();
00027                 /* @var $notification DAONotifications */
00028                 $notification = $this->get_instance();
00029                 if ($notification->is_active()) {
00030                         $update_params = array(
00031                                 'read_through' => Notifications::READ_UNKNOWN,
00032                                 'read_action' => new DBNull()
00033                         );
00034                         Arr::clean($update_params, $this->get_params());
00035                         $this->append(CommandsFactory::create_command($notification, 'status', Notifications::STATUS_READ));
00036                         $this->append(CommandsFactory::create_command($notification, 'update', $update_params));
00037                         
00038                         // Confirm email, if click came from email 
00039                         if ($update_params['read_through'] == Notifications::READ_MAIL) {
00040                                 $user = $notification->get_user();
00041                                 Users::confirm_email($user);
00042                         }
00043                 }
00044                 return $ret;
00045         }
MarkreadNotificationsCommand::get_description (  ) 

Returns a description of this command.

Reimplemented from CommandBase.

Definition at line 16 of file markread.cmd.php.

00016                                           {
00017                 return tr('Mark as read', 'notifications');
00018         }
MarkreadNotificationsCommand::get_name (  ) 

Returns title of command.

Reimplemented from CommandBase.

Definition at line 9 of file markread.cmd.php.

00009                                    {
00010                 return 'markread';
00011         }

The documentation for this class was generated from the following file:
  • contributions/usermanagement.notifications/behaviour/commands/notifications/markread.cmd.php