wrap result mapper
@param Cursor|array $mapper
@return Cortex
772218
protected function factory($mapper) {
		if (is_array($mapper)) {
			$mp = clone($this->mapper);
			$mp->reset();
			$cx = $this->factory($mp);
			$cx->copyfrom($mapper);
		} else {
			$cx = clone($this);
			$cx->reset(false);
			$cx->mapper = $mapper;
		}
		$cx->emit('load');
		return $cx;
	}
1313288
public function mapKeys(callable $keyMapper): self
    {
        return new self(
                new MappingIterator(
                        $this->getIterator(),
                        null,
                        $keyMapper
                ),
                $this->type
        );
    }
1360103
public function bind(string $view, $mapper)
    {
        if ($mapper instanceof \Closure) {
            return $this->set($view, $mapper($this, $view));
        }

        return $this->set($view, $mapper);
    }
5705
protected function mapper($alias = false)
    {
        return Manager::getInstance()->getMapper($alias ? $alias : $this->sMapperAlias);
    }
411494
private function getCustomMapper(MappingInterface $mapping): ?MapperInterface
    {
        $customMapper = $mapping->getCustomMapper();

        if ($customMapper instanceof MapperAwareOperation) {
            $customMapper->setMapper($this);
        }

        return $customMapper;
    }
844154
public function getMapper($mapperClass = null, array $options = [])
    {
        $mapperClass = $mapperClass ?? $this->mapper ?? $this->serviceAlias;

        if (!array_key_exists($mapperClass, $this->mappers)) {
            $this->setMapper($mapperClass, $options);
        }

        return $this->mappers[$mapperClass];
    }
958300
public function checkMapper(string $mapper): bool
    {
        if (!isset($this->$mapper)) {
            Schematic::error('Mapper '.$mapper.' not found');

            return false;
        }
        if (!$this->$mapper instanceof MapperInterface) {
            Schematic::error(get_class($this->$mapper).' does not implement MapperInterface');

            return false;
        }

        return true;
    }
1103359
@SuppressWarnings("unchecked")
    public final B addMapper(FieldMapper<ROW, T> mapper) {
        setRowMapperBuilder.addMapper(mapper);
        return (B) this;
    }
1063448
public function getMapper()
    {
        if (!$this->mapper instanceof UserProvider) {
            $this->setMapper($this->getServiceManager()->get('playgrounduser_userprovider_mapper'));
        }

        return $this->mapper;
    }
1350896
public function mapsOf( $region ) {
        return new MapEndpoint( $this->api, $this->continent, $this->floor, $region );
    }
1243285
public function addSqlResultSetMapping(array $resultMapping)
    {
        if (!isset($resultMapping['name'])) {
            throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name);
        }

        if (isset($this->sqlResultSetMappings[$resultMapping['name']])) {
            throw MappingException::duplicateResultSetMapping($this->name, $resultMapping['name']);
        }

        if (isset($resultMapping['entities'])) {
            foreach ($resultMapping['entities'] as $key => $entityResult) {
                if (!isset($entityResult['entityClass'])) {
                    throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']);
                }

                $entityResult['isSelfClass'] = false;
                if ($entityResult['entityClass'] === '__CLASS__') {

                    $entityResult['isSelfClass'] = true;
                    $entityResult['entityClass'] = $this->name;

                }

                $entityResult['entityClass'] = $this->fullyQualifiedClassName($entityResult['entityClass']);

                $resultMapping['entities'][$key]['entityClass'] = ltrim($entityResult['entityClass'], '\\');
                $resultMapping['entities'][$key]['isSelfClass'] = $entityResult['isSelfClass'];

                if (isset($entityResult['fields'])) {
                    foreach ($entityResult['fields'] as $k => $field) {
                        if (!isset($field['name'])) {
                            throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']);
                        }

                        if (!isset($field['column'])) {
                            $fieldName = $field['name'];
                            if (strpos($fieldName, '.')) {
                                list(, $fieldName) = explode('.', $fieldName);
                            }

                            $resultMapping['entities'][$key]['fields'][$k]['column'] = $fieldName;
                        }
                    }
                }
            }
        }

        $this->sqlResultSetMappings[$resultMapping['name']] = $resultMapping;
    }
1313938
private function wrapCursor(Cursor $baseCursor) : Iterator
    {
        return new CachingIterator(new HydratingIterator($baseCursor, $this->dm->getUnitOfWork(), $this->class));
    }
5532
public function tab($name, $mapper)
	{
		$this->tab = $name;

		if ($mapper instanceof Closure) {
			$mapper($this);
		}
	}
714675
public function content($mapper, $data)
    {
        $response = call_user_func_array([$this, 'respond'], func_get_args());

        return $response->getData(true);
    }
1298025
protected function _decorateResults($result)
    {
        $decorator = $this->_decoratorClass();
        foreach ($this->_mapReduce as $functions) {
            $result = new MapReduce($result, $functions['mapper'], $functions['reducer']);
        }

        if (!empty($this->_mapReduce)) {
            $result = new $decorator($result);
        }

        foreach ($this->_formatters as $formatter) {
            $result = $formatter($result);
        }

        if (!empty($this->_formatters) && !($result instanceof $decorator)) {
            $result = new $decorator($result);
        }

        return $result;
    }
711496
function keyMapper(mapper) {
  return obj => {
    if (!isObject(obj) || Array.isArray(obj)) {
      return obj;
    }

    const keys = Object.keys(obj);
    const out = {};

    for (let i = 0, l = keys.length; i < l; ++i) {
      const key = keys[i];
      out[mapper(key)] = obj[key];
    }

    return out;
  };
}
1207977
private function createMapper($entity)
    {
        $mapper = new EntityMapper();
        $mapper->setAdapter(
            $this->adapters->get(
                $this->getAdapterAlias($entity)
            )
        )
            ->setEntityClassName($entity);
        $this->mappers->set($entity, $mapper);
        return $mapper;
    }