yii2tech / ar-variation

Variation behavior for ActiveRecord
Other
48 stars 10 forks source link

Unable to handle variation relation with extra condition #9

Closed klimov-paul closed 8 years ago

klimov-paul commented 8 years ago

Variation relation may have extra attributes conditions, for example:

public function getFeaturedItems()
    {
        return $this->hasMany(Item::className(), ['collectionId' => 'id'])->andWhere(['type' => 'featured']);
    }

In this case extra condition should be converted to the variation model attributes, prefilling type

klimov-paul commented 8 years ago

Resolved by commit 7a0d27e4d89a363db4ce22a91b738acc84005f4b