src/Represent/Builder/Format/HalFormatBuilder.php
protected function getEmbedded($representation, \ReflectionClass $reflection)
    {
        $embedded   = new \stdClass();
        $properties = $reflection->getProperties();
        $reader     = $this->reader;

        array_walk(
            $properties,
            function (\ReflectionProperty $property) use ($representation, $embedded, $reader) {
                $property->setAccessible(true);
                $annot = $reader->getPropertyAnnotation($property, '\Represent\Annotations\Embedded');

                if ($annot) {
                    $name  = $property->getName();
                    $value = $representation->$name;
                    $embedded->$name = $value;
                    unset($representation->$name);
                }
            }
        );

        return $embedded;
    }
protected function getEmbedded($representation, \ReflectionClass $reflection)
    {
        $embedded   = new \stdClass();
        $properties = $reflection->getProperties();
        $reader     = $this->reader;

        array_walk(
            $properties,
            function (\ReflectionProperty $property) use ($representation, $embedded, $reader) {
                $property->setAccessible(true);
                $annot = $reader->getPropertyAnnotation($property, '\Represent\Annotations\Embedded');

                if ($annot) {
                    $name  = $property->getName();
                    $value = $representation->$name;
                    $embedded->$name = $value;
                    unset($representation->$name);
                }
            }
        );

        return $embedded;
    }
protected function getEmbedded ( $ representation , \ ReflectionClass $ reflection ) { $ embedded = new \ stdClass ( ) ; $ properties = $ reflection -> getProperties ( ) ; $ reader = $ this -> reader ; array_walk ( $ properties , function ( \ ReflectionProperty $ property ) use ( $ representation , $ embedded , $ reader ) { $ property -> setAccessible ( true ) ; $ annot = $ reader -> getPropertyAnnotation ( $ property , '\Represent\Annotations\Embedded' ) ; if ( $ annot ) { $ name = $ property -> getName ( ) ; $ value = $ representation -> $ name ; $ embedded -> $ name = $ value ; unset ( $ representation -> $ name ) ; } } ) ; return $ embedded ; }
Handles moving embedded properties to _embedded
@param                  $representation
@param \ReflectionClass $reflection
@return \stdClass
Handles moving embedded properties to _embedded