0], [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'product_id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'product_to_rating_id' => Yii::t('app', 'product_to_rating_id'), 'product_id' => Yii::t('app', 'product_id'), 'value' => Yii::t('app', 'value'), ]; } /** * @return \yii\db\ActiveQuery */ public function getProduct() { return $this->hasOne(Product::className(), ['product_id' => 'product_id']); } }