Skip to content
Browse files

Added usage example to CDbCriteria phpdoc

  • Loading branch information...
1 parent 22a5213 commit b74caf360649fddbce8c563764308e0674650eee @samdark samdark committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 framework/db/schema/CDbCriteria.php
View
8 framework/db/schema/CDbCriteria.php
@@ -11,6 +11,14 @@
/**
* CDbCriteria represents a query criteria, such as conditions, ordering by, limit/offset.
*
+ * It can be used in AR query methods such as CActiveRecord::find and CActiveRecord::findAll.
+ *
+ * $criteria=new CDbCriteria();
+ * $criteria->compare('status',Post::STATUS_ACTIVE);
+ * $criteria->addInCondition('id',array(1,2,3,4,5,6));
+ *
+ * $posts = Post::model()->findAll($criteria);
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$
* @package system.db.schema

0 comments on commit b74caf3

Please sign in to comment.
Something went wrong with that request. Please try again.