Use an INotification to getCount() and markProcessed()

This commit is contained in:
Joas Schilling 2015-09-01 10:46:32 +02:00
parent 3bdfef9107
commit 913e2e9ae6
2 changed files with 10 additions and 18 deletions

View file

@ -155,31 +155,27 @@ class Manager implements IManager {
}
/**
* @param string $appId
* @param string $objectType
* @param int $objectId
* @param string $user
* @param INotification $notification
* @return null
*/
public function markProcessed($appId, $objectType, $objectId, $user = '') {
public function markProcessed(INotification $notification) {
$apps = $this->getApps();
foreach ($apps as $app) {
$app->markProcessed($appId, $objectType, $objectId, $user);
$app->markProcessed($notification);
}
}
/**
* @param string $user
* @param string $appId
* @param INotification $notification
* @return int
*/
public function getCount($user, $appId = '') {
public function getCount(INotification $notification) {
$apps = $this->getApps();
$count = 0;
foreach ($apps as $app) {
$count += $app->markProcessed($user, $appId);
$count += $app->markProcessed($notification);
}
return $count;

View file

@ -41,20 +41,16 @@ interface IApp {
public function notify(INotification $notification);
/**
* @param string $appId
* @param string $objectType
* @param int $objectId
* @param string $user
* @param INotification $notification
* @return null
* @since 8.2.0
*/
public function markProcessed($appId, $objectType, $objectId, $user = '');
public function markProcessed(INotification $notification);
/**
* @param string $user
* @param string $appId
* @param INotification $notification
* @return int
* @since 8.2.0
*/
public function getCount($user, $appId = '');
public function getCount(INotification $notification);
}