src/UthandoCommon/Service/AbstractMapperService.php
public function setMapper($mapperClass, array $options = [])
    {
        $sl             = $this->getServiceLocator();
        $mapperManager  = $sl->get(MapperManager::class);

        $defaultOptions = [
            'model' => $this->model ?? $this->serviceAlias,
            'hydrator' => $this->hydrator ?? $this->serviceAlias,
        ];

        $options    = array_merge($defaultOptions, $options);
        $mapper     = $mapperManager->get($mapperClass, $options);

        $this->mappers[$mapperClass] = $mapper;

        return $this;
    }
public function setMapper($mapperClass, array $options = [])
    {
        $sl             = $this->getServiceLocator();
        $mapperManager  = $sl->get(MapperManager::class);

        $defaultOptions = [
            'model' => $this->model ?? $this->serviceAlias,
            'hydrator' => $this->hydrator ?? $this->serviceAlias,
        ];

        $options    = array_merge($defaultOptions, $options);
        $mapper     = $mapperManager->get($mapperClass, $options);

        $this->mappers[$mapperClass] = $mapper;

        return $this;
    }
public function setMapper ( $ mapperClass , array $ options = [ ] ) { $ sl = $ this -> getServiceLocator ( ) ; $ mapperManager = $ sl -> get ( MapperManager :: class ) ; $ defaultOptions = [ 'model' => $ this -> model ?? $ this -> serviceAlias , 'hydrator' => $ this -> hydrator ?? $ this -> serviceAlias , ] ; $ options = array_merge ( $ defaultOptions , $ options ) ; $ mapper = $ mapperManager -> get ( $ mapperClass , $ options ) ; $ this -> mappers [ $ mapperClass ] = $ mapper ; return $ this ; }
Sets mapper in mapper array for reuse.

@param string $mapperClass
@param array $options
@return $this
Sets mapper in mapper array for reuse .