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

Searching and Sorting by Count of Related Items in CGridView

Created 3 years ago by softarkHow-tos13 comments – viewed 37,190 times – ( +31 ) – version 1.1
Let's say we have two models and relation between them:

Filter & Sort by Summary Data in GridView Yii 2.0

Created about a year ago by Kartik VTutorials6 comments – viewed 19,370 times – ( +39 / -4 ) – version 2.0
This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.

Relation scope to test existence of related records ("EXISTS")

Created 6 months ago by le_topHow-tos0 comments – viewed 2,790 times – ( +1 ) – version 1.1
When one needs to select a record in a table that do not have related records through a relation, it is generally suggested to use a subquery. Personnaly, I prefer a high level approach, and I have a method to do it with scopes.