Wiki articles in category How-tos tagged with "count"

Showing 1-2 of 2 items.

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

Created 8 years ago by le_top, updated 8 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
Viewed: 13 515 times
Version: 1.1
Category: How-tos

Searching and Sorting by Count of Related Items in CGridView

Created 11 years ago by softark, updated 8 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
Viewed: 57 934 times
Version: 1.1
Category: How-tos