original_string: public function getMethods($routeId, $version = null, $active = true, $cache = false)
      {
          $fields = ['method.id', 'method.route_id', 'method.version', 'method.status', 'method.method', 'method.active', 'method.public', 'method.description', 'method.parameters', 'method.request', 'method.action', 'method.costs'];
          if ($cache) {
              $fields[] = 'method.schema_cache';
          }
  
          $sql = '  SELECT ' . implode(',', $fields) . '
                      FROM fusio_routes_method method
                     WHERE method.route_id = :route_id';
  
          $params = ['route_id' => $routeId];
  
          if ($active !== null) {
              $sql.= ' AND method.active = ' . ($active ? '1' : '0');
          }
  
          if ($version !== null) {
              $sql.= ' AND method.version = :version';
              $params['version'] = $version;
          }
  
          $sql.= ' ORDER BY method.version ASC, method.id ASC';
  
          return $this->project($sql, $params);
      }
code: public function getMethods($routeId, $version = null, $active = true, $cache = false)
      {
          $fields = ['method.id', 'method.route_id', 'method.version', 'method.status', 'method.method', 'method.active', 'method.public', 'method.description', 'method.parameters', 'method.request', 'method.action', 'method.costs'];
          if ($cache) {
              $fields[] = 'method.schema_cache';
          }
  
          $sql = '  SELECT ' . implode(',', $fields) . '
                      FROM fusio_routes_method method
                     WHERE method.route_id = :route_id';
  
          $params = ['route_id' => $routeId];
  
          if ($active !== null) {
              $sql.= ' AND method.active = ' . ($active ? '1' : '0');
          }
  
          if ($version !== null) {
              $sql.= ' AND method.version = :version';
              $params['version'] = $version;
          }
  
          $sql.= ' ORDER BY method.version ASC, method.id ASC';
  
          return $this->project($sql, $params);
      }
code_tokens: public function getMethods ( $ routeId , $ version = null , $ active = true , $ cache = false ) { $ fields = [ 'method.id' , 'method.route_id' , 'method.version' , 'method.status' , 'method.method' , 'method.active' , 'method.public' , 'method.description' , 'method.parameters' , 'method.request' , 'method.action' , 'method.costs' ] ; if ( $ cache ) { $ fields [ ] = 'method.schema_cache' ; } $ sql = '  SELECT ' . implode ( ',' , $ fields ) . '
                      FROM fusio_routes_method method
                     WHERE method.route_id = :route_id' ; $ params = [ 'route_id' => $ routeId ] ; if ( $ active !== null ) { $ sql .= ' AND method.active = ' . ( $ active ? '1' : '0' ) ; } if ( $ version !== null ) { $ sql .= ' AND method.version = :version' ; $ params [ 'version' ] = $ version ; } $ sql .= ' ORDER BY method.version ASC, method.id ASC' ; return $ this -> project ( $ sql , $ params ) ; }
docstring: Returns only active methods for the route
  
  @param integer $routeId
  @param integer $version
  @param boolean $active
  @param boolean $cache
  @return array
docstring_tokens: Returns only active methods for the route