Wiki

Articles tagged with "has_many", sorted by ratingX
Displaying 1-3 of 3 result(s).

Drills : Search by a HAS_MANY relation

Created 5 months ago by softarkTutorials9 comments – viewed 7,575 times – ( +20 )
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.

1:n relations sometimes require CDbCriteria.together

Created about a year ago by fsbTips4 comments – viewed 13,739 times – ( +13 )
There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 8 months ago by yJeroenTutorials8 comments – viewed 16,239 times – ( +11 )
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.