public static function removeNotification($type, $targetId, $userId) { $mapper = new NotificationMapper(); return $mapper->delete(['type' => $type, 'target_id' => $targetId, 'user_id' => $userId]); }
/** * 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); }