public function from($entityMapperTypeOrFactory)
    {
        if (is_callable($entityMapperTypeOrFactory)) {
            call_user_func($this->callback, $entityMapperTypeOrFactory);
        } elseif (is_a($entityMapperTypeOrFactory, IEntityMapper::class, true)) {
            call_user_func($this->callback, function (IOrm $orm) use ($entityMapperTypeOrFactory) {
                if ($this->iocContainer) {
                    return $this->iocContainer->bindForCallback(IOrm::class, $orm, function () use ($entityMapperTypeOrFactory) {
                        return  $this->iocContainer->get($entityMapperTypeOrFactory);
                    });
                }
                
                return new $entityMapperTypeOrFactory($orm);
            });
        } else {
            throw InvalidArgumentException::format(
                    'Invalid entity object factory: expecting callable or type of %s, %s given',
                    IEntityMapper::class, $entityMapperTypeOrFactory
            );
        }
    }
public function from($entityMapperTypeOrFactory)
    {
        if (is_callable($entityMapperTypeOrFactory)) {
            call_user_func($this->callback, $entityMapperTypeOrFactory);
        } elseif (is_a($entityMapperTypeOrFactory, IEntityMapper::class, true)) {
            call_user_func($this->callback, function (IOrm $orm) use ($entityMapperTypeOrFactory) {
                if ($this->iocContainer) {
                    return $this->iocContainer->bindForCallback(IOrm::class, $orm, function () use ($entityMapperTypeOrFactory) {
                        return  $this->iocContainer->get($entityMapperTypeOrFactory);
                    });
                }
                
                return new $entityMapperTypeOrFactory($orm);
            });
        } else {
            throw InvalidArgumentException::format(
                    'Invalid entity object factory: expecting callable or type of %s, %s given',
                    IEntityMapper::class, $entityMapperTypeOrFactory
            );
        }
    }
public function from ( $ entityMapperTypeOrFactory ) { if ( is_callable ( $ entityMapperTypeOrFactory ) ) { call_user_func ( $ this -> callback , $ entityMapperTypeOrFactory ) ; } elseif ( is_a ( $ entityMapperTypeOrFactory , IEntityMapper :: class , true ) ) { call_user_func ( $ this -> callback , function ( IOrm $ orm ) use ( $ entityMapperTypeOrFactory ) { if ( $ this -> iocContainer ) { return $ this -> iocContainer -> bindForCallback ( IOrm :: class , $ orm , function ( ) use ( $ entityMapperTypeOrFactory ) { return $ this -> iocContainer -> get ( $ entityMapperTypeOrFactory ) ; } ) ; } return new $ entityMapperTypeOrFactory ( $ orm ) ; } ) ; } else { throw InvalidArgumentException :: format ( 'Invalid entity object factory: expecting callable or type of %s, %s given' , IEntityMapper :: class , $ entityMapperTypeOrFactory ) ; } }
Sets the type of the entity mapper. If a callback
is passed it will be called to get the entity mapper.

@param string|callable $entityMapperTypeOrFactory

@return void
@throws InvalidArgumentException
Sets the type of the entity mapper . If a callback is passed it will be called to get the entity mapper .