original_string: public function setRowCount($rowCount)
      {
          if ($rowCount instanceof \Doctrine_Query) {
              $sql = $rowCount->getSql();
  
              if (false === strpos($sql, self::ROW_COUNT_COLUMN)) {
                  throw new \Zend_Paginator_Exception('Row count column not found');
              }
  
              $result = $rowCount->fetchOne()->toArray();
  
              $this->_rowCount = count($result) > 0 ? $result[self::ROW_COUNT_COLUMN] : 0;
          } else if (is_integer($rowCount)) {
              $this->_rowCount = $rowCount;
          } else {
              throw new \Zend_Paginator_Exception('Invalid row count');
          }
  
          return $this;
      }
code: public function setRowCount($rowCount)
      {
          if ($rowCount instanceof \Doctrine_Query) {
              $sql = $rowCount->getSql();
  
              if (false === strpos($sql, self::ROW_COUNT_COLUMN)) {
                  throw new \Zend_Paginator_Exception('Row count column not found');
              }
  
              $result = $rowCount->fetchOne()->toArray();
  
              $this->_rowCount = count($result) > 0 ? $result[self::ROW_COUNT_COLUMN] : 0;
          } else if (is_integer($rowCount)) {
              $this->_rowCount = $rowCount;
          } else {
              throw new \Zend_Paginator_Exception('Invalid row count');
          }
  
          return $this;
      }
code_tokens: public function setRowCount ( $ rowCount ) { if ( $ rowCount instanceof \ Doctrine_Query ) { $ sql = $ rowCount -> getSql ( ) ; if ( false === strpos ( $ sql , self :: ROW_COUNT_COLUMN ) ) { throw new \ Zend_Paginator_Exception ( 'Row count column not found' ) ; } $ result = $ rowCount -> fetchOne ( ) -> toArray ( ) ; $ this -> _rowCount = count ( $ result ) > 0 ? $ result [ self :: ROW_COUNT_COLUMN ] : 0 ; } else if ( is_integer ( $ rowCount ) ) { $ this -> _rowCount = $ rowCount ; } else { throw new \ Zend_Paginator_Exception ( 'Invalid row count' ) ; } return $ this ; }
docstring: Sets the total row count, either directly or through a supplied query
  
  @param  \Doctrine_Query|integer $totalRowCount Total row count integer
  or query
  @return \Zend_Paginator_Adapter_Doctrine $this
  @throws \Zend_Paginator_Exception
docstring_tokens: Sets the total row count either directly or through a supplied query