original_string: public function limit($num)
      {
          $this->_dirty();
          if ($num !== null && !is_object($num)) {
              $num = (int)$num;
          }
          $this->_parts['limit'] = $num;
  
          return $this;
      }
code: public function limit($num)
      {
          $this->_dirty();
          if ($num !== null && !is_object($num)) {
              $num = (int)$num;
          }
          $this->_parts['limit'] = $num;
  
          return $this;
      }
code_tokens: public function limit ( $ num ) { $ this -> _dirty ( ) ; if ( $ num !== null && ! is_object ( $ num ) ) { $ num = ( int ) $ num ; } $ this -> _parts [ 'limit' ] = $ num ; return $ this ; }
docstring: Sets the number of records that should be retrieved from database,
  accepts an integer or an expression object that evaluates to an integer.
  In some databases, this operation might not be supported or will require
  the query to be transformed in order to limit the result set size.
  
  ### Examples
  
  ```
  $query->limit(10) // generates LIMIT 10
  $query->limit($query->newExpr()->add(['1 + 1'])); // LIMIT (1 + 1)
  ```
  
  @param int|\Cake\Database\ExpressionInterface $num number of records to be returned
  @return $this
docstring_tokens: Sets the number of records that should be retrieved from database accepts an integer or an expression object that evaluates to an integer . In some databases this operation might not be supported or will require the query to be transformed in order to limit the result set size .