limit

  // AR Limit, Offset
  public function limit($limit = 0, $offset = 0)
  {
 
    $this->_limit = (int)Yii::app()->request->getParam('limit');
    $this->_offset = (int)Yii::app()->request->getParam('offset');    
 
    $this->getDbCriteria()->mergeWith(
      array(
        'limit' => $limit ? $limit : $this->_limit,
        'offset' => $offset ? $offset : $this->_offset,
        )
    );
    return $this;
  }