public function from($embeddedObjectMapperTypeOrFactory)
    {
        if (is_callable($embeddedObjectMapperTypeOrFactory)) {
            call_user_func($this->callback, $embeddedObjectMapperTypeOrFactory);
        } elseif (is_a($embeddedObjectMapperTypeOrFactory, IndependentValueObjectMapper::class, true)) {
            call_user_func($this->callback, function () use ($embeddedObjectMapperTypeOrFactory) {
                return $this->iocContainer ? $this->iocContainer->get($embeddedObjectMapperTypeOrFactory) : new $embeddedObjectMapperTypeOrFactory();
            });
        } elseif (is_a($embeddedObjectMapperTypeOrFactory, IEmbeddedObjectMapper::class, true)) {
            call_user_func($this->callback, function (IOrm $orm, IObjectMapper $parentMapper) use ($embeddedObjectMapperTypeOrFactory) {

                if ($this->iocContainer) {

                    return $this->iocContainer->bindForCallback(IOrm::class, $orm, function () use ($parentMapper, $embeddedObjectMapperTypeOrFactory) {

                        return $this->iocContainer->bindForCallback(IObjectMapper::class, $parentMapper, function () use ($embeddedObjectMapperTypeOrFactory) {
                            return  $this->iocContainer->get($embeddedObjectMapperTypeOrFactory);
                        });

                    });
                }

                return new $embeddedObjectMapperTypeOrFactory($orm, $parentMapper);
            });
        } else {
            throw InvalidArgumentException::format(
                'Invalid embedded object factory: expecting callable or type of %s, %s given',
                IEmbeddedObjectMapper::class, $embeddedObjectMapperTypeOrFactory
            );
        }
    }
public function from($embeddedObjectMapperTypeOrFactory)
    {
        if (is_callable($embeddedObjectMapperTypeOrFactory)) {
            call_user_func($this->callback, $embeddedObjectMapperTypeOrFactory);
        } elseif (is_a($embeddedObjectMapperTypeOrFactory, IndependentValueObjectMapper::class, true)) {
            call_user_func($this->callback, function () use ($embeddedObjectMapperTypeOrFactory) {
                return $this->iocContainer ? $this->iocContainer->get($embeddedObjectMapperTypeOrFactory) : new $embeddedObjectMapperTypeOrFactory();
            });
        } elseif (is_a($embeddedObjectMapperTypeOrFactory, IEmbeddedObjectMapper::class, true)) {
            call_user_func($this->callback, function (IOrm $orm, IObjectMapper $parentMapper) use ($embeddedObjectMapperTypeOrFactory) {

                if ($this->iocContainer) {

                    return $this->iocContainer->bindForCallback(IOrm::class, $orm, function () use ($parentMapper, $embeddedObjectMapperTypeOrFactory) {

                        return $this->iocContainer->bindForCallback(IObjectMapper::class, $parentMapper, function () use ($embeddedObjectMapperTypeOrFactory) {
                            return  $this->iocContainer->get($embeddedObjectMapperTypeOrFactory);
                        });

                    });
                }

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

@param string|callable $embeddedObjectMapperTypeOrFactory

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