diff --git a/models/Subscription.php b/models/Subscription.php index a230dc2..ac5bf04 100644 --- a/models/Subscription.php +++ b/models/Subscription.php @@ -5,7 +5,7 @@ namespace app\models; class Subscription extends \yii\db\ActiveRecord { public $user_id; - public $company_id; + public $blog_id; /** * {@inheritDoc} @@ -13,7 +13,7 @@ class Subscription extends \yii\db\ActiveRecord public function rules() { return [ - [['user_id'], 'required'], + [['user_id', 'blog_id'], 'required'], [['id'], 'integer'], ]; } @@ -23,9 +23,9 @@ class Subscription extends \yii\db\ActiveRecord return $this->hasOne(User::class, [ 'id' => 'user_id' ]); } - public function getCompany() + public function getBlog() { - return $this->hasOne(Company::class, [ 'id' => 'company_id' ]); + return $this->hasOne(Company::class, [ 'id' => 'blog_id' ]); } /**