original_string: public function get_courses_count($options = array()) {
          $cntcachekey = 'lcnt-'. $this->id. '-'. (!empty($options['recursive']) ? 'r' : '');
          $coursecatcache = cache::make('core', 'coursecat');
          if (($cnt = $coursecatcache->get($cntcachekey)) === false) {
              // Cached value not found. Retrieve ALL courses and return their count.
              unset($options['offset']);
              unset($options['limit']);
              unset($options['summary']);
              unset($options['coursecontacts']);
              $options['idonly'] = true;
              $courses = $this->get_courses($options);
              $cnt = count($courses);
          }
          return $cnt;
      }
code: public function get_courses_count($options = array()) {
          $cntcachekey = 'lcnt-'. $this->id. '-'. (!empty($options['recursive']) ? 'r' : '');
          $coursecatcache = cache::make('core', 'coursecat');
          if (($cnt = $coursecatcache->get($cntcachekey)) === false) {
              // Cached value not found. Retrieve ALL courses and return their count.
              unset($options['offset']);
              unset($options['limit']);
              unset($options['summary']);
              unset($options['coursecontacts']);
              $options['idonly'] = true;
              $courses = $this->get_courses($options);
              $cnt = count($courses);
          }
          return $cnt;
      }
code_tokens: public function get_courses_count ( $ options = array ( ) ) { $ cntcachekey = 'lcnt-' . $ this -> id . '-' . ( ! empty ( $ options [ 'recursive' ] ) ? 'r' : '' ) ; $ coursecatcache = cache :: make ( 'core' , 'coursecat' ) ; if ( ( $ cnt = $ coursecatcache -> get ( $ cntcachekey ) ) === false ) { // Cached value not found. Retrieve ALL courses and return their count. unset ( $ options [ 'offset' ] ) ; unset ( $ options [ 'limit' ] ) ; unset ( $ options [ 'summary' ] ) ; unset ( $ options [ 'coursecontacts' ] ) ; $ options [ 'idonly' ] = true ; $ courses = $ this -> get_courses ( $ options ) ; $ cnt = count ( $ courses ) ; } return $ cnt ; }
docstring: Returns number of courses visible to the user
  
  @param array $options similar to get_courses() except some options do not affect
  number of courses (i.e. sort, summary, offset, limit etc.)
  @return int
docstring_tokens: Returns number of courses visible to the user