Fix NotificationCategory component

This commit is contained in:
Carlos Ferreira 2018-01-14 16:06:12 +01:00 committed by GitHub
parent e7e56ff20a
commit 7c18919953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,19 +8,20 @@
namespace humhub\modules\notification\components;
use yii\base\InvalidConfigException;
use humhub\modules\user\models\User;
use humhub\modules\notification\targets\BaseTarget;
use humhub\modules\notification\targets\MailTarget;
use humhub\modules\notification\targets\WebTarget;
use humhub\modules\notification\targets\MobileTarget;
use yii\base\Object;
use yii\base\InvalidConfigException;
/**
* NotificationCategories are used to group different notifications in views and
* configure the notifications in the notification settings.
*
*/
abstract class NotificationCategory extends \yii\base\Object
abstract class NotificationCategory extends Object
{
/**
@ -48,12 +49,12 @@ abstract class NotificationCategory extends \yii\base\Object
/**
* Returns a human readable title of this category
*/
public abstract function getTitle();
abstract public function getTitle();
/**
* Returns a group description
*/
public abstract function getDescription();
abstract public function getDescription();
/**
* Returns the default enabled settings for the given $target.
@ -67,9 +68,9 @@ abstract class NotificationCategory extends \yii\base\Object
{
if ($target->id === MailTarget::getId()) {
return true;
} else if ($target->id === WebTarget::getId()) {
} elseif ($target->id === WebTarget::getId()) {
return true;
} else if ($target->id === MobileTarget::getId()) {
} elseif ($target->id === MobileTarget::getId()) {
return false;
}