protected function hydrateValueObject(&$attributes, $localKey, $valueClass)
    {
        $map = $this->mapper->getManager()->getValueMap($valueClass);

        $embeddedAttributes = $map->getAttributes();

        $valueObject = $this->mapper->getManager()->getValueObjectInstance($valueClass);
        $voWrapper = $this->factory->make($valueObject);

        foreach ($embeddedAttributes as $key) {
            $prefix = snake_case(class_basename($valueClass)).'_';

            $voWrapper->setEntityAttribute($key, $attributes[$prefix.$key]);

            unset($attributes[$prefix.$key]);
        }

        $attributes[$localKey] = $voWrapper->getObject();
    }
protected function hydrateValueObject(&$attributes, $localKey, $valueClass)
    {
        $map = $this->mapper->getManager()->getValueMap($valueClass);

        $embeddedAttributes = $map->getAttributes();

        $valueObject = $this->mapper->getManager()->getValueObjectInstance($valueClass);
        $voWrapper = $this->factory->make($valueObject);

        foreach ($embeddedAttributes as $key) {
            $prefix = snake_case(class_basename($valueClass)).'_';

            $voWrapper->setEntityAttribute($key, $attributes[$prefix.$key]);

            unset($attributes[$prefix.$key]);
        }

        $attributes[$localKey] = $voWrapper->getObject();
    }
protected function hydrateValueObject ( & $ attributes , $ localKey , $ valueClass ) { $ map = $ this -> mapper -> getManager ( ) -> getValueMap ( $ valueClass ) ; $ embeddedAttributes = $ map -> getAttributes ( ) ; $ valueObject = $ this -> mapper -> getManager ( ) -> getValueObjectInstance ( $ valueClass ) ; $ voWrapper = $ this -> factory -> make ( $ valueObject ) ; foreach ( $ embeddedAttributes as $ key ) { $ prefix = snake_case ( class_basename ( $ valueClass ) ) . '_' ; $ voWrapper -> setEntityAttribute ( $ key , $ attributes [ $ prefix . $ key ] ) ; unset ( $ attributes [ $ prefix . $ key ] ) ; } $ attributes [ $ localKey ] = $ voWrapper -> getObject ( ) ; }
Hydrate a single value object.

@param array  $attributes
@param string $localKey
@param string $valueClass

@throws \Analogue\ORM\Exceptions\MappingException

@return void
Hydrate a single value object .