-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Such taggable behaviors are a convenient way to store information for attributes that can take an array of values. And sometimes it is convenient to store information about different attributes in the same table using a special column to distinguish, say, category
. What would be very useful if this extension allowed to work (save, load, search etc) with multiple tag categories defined for the same model.
This functionality was available in Yii1 through taggable extension by @samdark and was very useful.
You could potentially build on top of existing approach by attaching multiple TaggableBehavior
behaviors, one per tag category, and adding a specific where
clause like ->where('category = :category', [':category' => $category]);
to each relation. But it has certain problems:
TaggableQueryBehavior
right now does not distinguish between owner's behaviors and uses$model->tagRelation
which would reference a relation from the first bahavior it finds instead of the one we need.- When saving tags, would be nice if tag category was saved automatically. This was handled by
insertValues
property in Yii1 taggable extension. - Yii1 taggable extension also provided useful methods like
getAllTagsWithModelsCount
, but this is less critical.