- Добавлен вызов функции afterSubscribe после того как юзер подписался

parent dd532f83
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace common\modules\bids\models; namespace common\modules\bids\models;
use common\modules\users\models\User;
use Yii; use Yii;
use common\models\Settings; use common\models\Settings;
...@@ -145,4 +146,20 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -145,4 +146,20 @@ class Bid extends \common\components\ActiveRecordModel
{ {
} }
} }
/**
* @param bool $insert
* @param array $changedAttributes
* @return bool
*/
public function afterSave($insert, $changedAttributes)
{
if (!parent::afterSave($insert, $changedAttributes))
return false;
/** @var User $user */
$user = User::find()->where(['email' => $this->email])->one();
if (!is_null($user)) {
$user->afterSubscribe();
}
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment