Wiki articles tagged with "count"

Showing 1-3 of 3 items.

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

Created 10 years ago by le_top, updated 10 years ago by le_top.

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.

1 0
2 followers
Viewed: 15 376 times
Version: 1.1
Category: How-tos

Filter & Sort by Summary Data in GridView Yii 2.0

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

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.

5 2
48 followers
Viewed: 74 336 times
Version: 2.0
Category: Tutorials

Searching and Sorting by Count of Related Items in CGridView

Created 13 years ago by softark, updated 10 years ago by softark.

class Post extends CActiveRecord {

...

} ` When you list Authors in grid you would like to print the count of posts in column, allow sorting on this column and probably filtering by the count.

21 0
40 followers
Viewed: 61 429 times
Version: 1.1
Category: How-tos