src/Serializer.php
protected function serializeEmbedOne(EmbedMetadata $embedMeta, Embed $embed = null)
    {
        if (null === $embed) {
            return;
        }
        $serialized = [];
        foreach ($embedMeta->getAttributes() as $key => $attrMeta) {
            $serialized[$key] = $this->serializeAttribute($embed->get($key), $attrMeta);
        }
        foreach ($embedMeta->getEmbeds() as $key => $embeddedPropMeta) {
            $serialized[$key] = $this->serializeEmbed($embed->get($key), $embeddedPropMeta);
        }

        return empty($serialized) ? null : $serialized;
    }
protected function serializeEmbedOne(EmbedMetadata $embedMeta, Embed $embed = null)
    {
        if (null === $embed) {
            return;
        }
        $serialized = [];
        foreach ($embedMeta->getAttributes() as $key => $attrMeta) {
            $serialized[$key] = $this->serializeAttribute($embed->get($key), $attrMeta);
        }
        foreach ($embedMeta->getEmbeds() as $key => $embeddedPropMeta) {
            $serialized[$key] = $this->serializeEmbed($embed->get($key), $embeddedPropMeta);
        }

        return empty($serialized) ? null : $serialized;
    }
protected function serializeEmbedOne ( EmbedMetadata $ embedMeta , Embed $ embed = null ) { if ( null === $ embed ) { return ; } $ serialized = [ ] ; foreach ( $ embedMeta -> getAttributes ( ) as $ key => $ attrMeta ) { $ serialized [ $ key ] = $ this -> serializeAttribute ( $ embed -> get ( $ key ) , $ attrMeta ) ; } foreach ( $ embedMeta -> getEmbeds ( ) as $ key => $ embeddedPropMeta ) { $ serialized [ $ key ] = $ this -> serializeEmbed ( $ embed -> get ( $ key ) , $ embeddedPropMeta ) ; } return empty ( $ serialized ) ? null : $ serialized ; }
Serializes an embed one value.

@param   EmbedMetadata   $embedMeta
@param   Embed|null      $embed
@return  array|null
Serializes an embed one value .