original_string: public function mapReduce(callable $mapper = null, callable $reducer = null, $overwrite = false)
      {
          if ($overwrite) {
              $this->_mapReduce = [];
          }
          if ($mapper === null) {
              if (!$overwrite) {
                  deprecationWarning(
                      'Using QueryTrait::mapReduce() as a getter is deprecated. ' .
                      'Use getMapReducers() instead.'
                  );
              }
  
              return $this->_mapReduce;
          }
          $this->_mapReduce[] = compact('mapper', 'reducer');
  
          return $this;
      }
code: public function mapReduce(callable $mapper = null, callable $reducer = null, $overwrite = false)
      {
          if ($overwrite) {
              $this->_mapReduce = [];
          }
          if ($mapper === null) {
              if (!$overwrite) {
                  deprecationWarning(
                      'Using QueryTrait::mapReduce() as a getter is deprecated. ' .
                      'Use getMapReducers() instead.'
                  );
              }
  
              return $this->_mapReduce;
          }
          $this->_mapReduce[] = compact('mapper', 'reducer');
  
          return $this;
      }
code_tokens: public function mapReduce ( callable $ mapper = null , callable $ reducer = null , $ overwrite = false ) { if ( $ overwrite ) { $ this -> _mapReduce = [ ] ; } if ( $ mapper === null ) { if ( ! $ overwrite ) { deprecationWarning ( 'Using QueryTrait::mapReduce() as a getter is deprecated. ' . 'Use getMapReducers() instead.' ) ; } return $ this -> _mapReduce ; } $ this -> _mapReduce [ ] = compact ( 'mapper' , 'reducer' ) ; return $ this ; }
docstring: Register a new MapReduce routine to be executed on top of the database results
  Both the mapper and caller callable should be invokable objects.
  
  The MapReduce routing will only be run when the query is executed and the first
  result is attempted to be fetched.
  
  If the first argument is set to null, it will return the list of previously
  registered map reduce routines. This is deprecated as of 3.6.0 - use getMapReducers() instead.
  
  If the third argument is set to true, it will erase previous map reducers
  and replace it with the arguments passed.
  
  @param callable|null $mapper The mapper callable.
  @param callable|null $reducer The reducing function.
  @param bool $overwrite Set to true to overwrite existing map + reduce functions.
  @return $this|array
  @see \Cake\Collection\Iterator\MapReduce for details on how to use emit data to the map reducer.
docstring_tokens: Register a new MapReduce routine to be executed on top of the database results Both the mapper and caller callable should be invokable objects .