Forum\Notification\Notification::removeNotification PHP Method

removeNotification() public static method

removeNotification
public static removeNotification ( string $type, integer $targetId, integer $userId ) : boolean
$type string
$targetId integer
$userId integer
return boolean
    public static function removeNotification($type, $targetId, $userId)
    {
        $mapper = new NotificationMapper();
        return $mapper->delete(['type' => $type, 'target_id' => $targetId, 'user_id' => $userId]);
    }

Usage Example

Beispiel #1
0
 /**
  * doSave
  *
  * @param Data $data
  *
  * @return  void
  *
  * @throws ValidFailException
  */
 protected function doSave(Data $data)
 {
     $user = User::get();
     if (!$user->isMember()) {
         throw new ValidFailException('User not login');
     }
     Notification::removeNotification($data->type, $data->target_id, $user->id);
 }