diff --git a/protected/humhub/modules/search/behaviors/Searchable.php b/protected/humhub/modules/search/behaviors/Searchable.php index a68bd79ab9..8509fdc064 100644 --- a/protected/humhub/modules/search/behaviors/Searchable.php +++ b/protected/humhub/modules/search/behaviors/Searchable.php @@ -12,6 +12,7 @@ use Yii; use yii\db\ActiveRecord; use yii\base\Behavior; use yii\console\Exception; +use humhub\modules\search\interfaces\Searchable; /** * Searchable Behavior @@ -35,19 +36,19 @@ class Searchable extends Behavior public function afterSave($event) { - if ($this->owner instanceof \humhub\modules\search\interfaces\Searchable) { + if ($this->owner instanceof Searchable) { Yii::$app->search->update($this->owner); } else { - throw new Exception("Owner of HSearchableBehavior must be implement interface ISearchable"); + throw new Exception('Owner of HSearchableBehavior must be implement interface ISearchable'); } } public function afterDelete($event) { - if ($this->owner instanceof \humhub\modules\search\interfaces\Searchable) { + if ($this->owner instanceof Searchable) { Yii::$app->search->delete($this->owner); } else { - throw new Exception("Owner of HSearchableBehavior must be implement interface ISearchable"); + throw new Exception('Owner of HSearchableBehavior must be implement interface ISearchable'); } }