/** * @return \yii\db\ActiveQuery */ public function getShopAttributes() { return $this->hasMany(ShopAttribute::className(), ['type_id' => 'id']); }
/** * @inheritdoc */ public function rules() { return [[['attribute_id'], 'integer'], [['attribute_id'], 'exist', 'skipOnError' => true, 'targetClass' => ShopAttribute::className(), 'targetAttribute' => ['attribute_id' => 'id']]]; }