protected function join($key, $value, $level = 0)
    {
        if ($level > 0) {
            $key = $key . self::LEVEL_SEPARATOR . $level;
        }

        $valueParts = [];
        foreach ($this->unSerializeMap($value) as $mappedKey) {
            $mappedKey = $this->transformReferenceToMappedKey($mappedKey);
            $valueParts[$this->getMappedKeyIndex($mappedKey, $key)] = $this->getDriver()->get($mappedKey);
        }

        uksort($valueParts, 'strnatcmp');
        $value = implode('', $valueParts);
        if ($this->isSplit($value)) {
            $value = $this->join($key, $value, $level + 1);
        }
        return $value;
    }
protected function join($key, $value, $level = 0)
    {
        if ($level > 0) {
            $key = $key . self::LEVEL_SEPARATOR . $level;
        }

        $valueParts = [];
        foreach ($this->unSerializeMap($value) as $mappedKey) {
            $mappedKey = $this->transformReferenceToMappedKey($mappedKey);
            $valueParts[$this->getMappedKeyIndex($mappedKey, $key)] = $this->getDriver()->get($mappedKey);
        }

        uksort($valueParts, 'strnatcmp');
        $value = implode('', $valueParts);
        if ($this->isSplit($value)) {
            $value = $this->join($key, $value, $level + 1);
        }
        return $value;
    }
protected function join ( $ key , $ value , $ level = 0 ) { if ( $ level > 0 ) { $ key = $ key . self :: LEVEL_SEPARATOR . $ level ; } $ valueParts = [ ] ; foreach ( $ this -> unSerializeMap ( $ value ) as $ mappedKey ) { $ mappedKey = $ this -> transformReferenceToMappedKey ( $ mappedKey ) ; $ valueParts [ $ this -> getMappedKeyIndex ( $ mappedKey , $ key ) ] = $ this -> getDriver ( ) -> get ( $ mappedKey ) ; } uksort ( $ valueParts , 'strnatcmp' ) ; $ value = implode ( '' , $ valueParts ) ; if ( $ this -> isSplit ( $ value ) ) { $ value = $ this -> join ( $ key , $ value , $ level + 1 ) ; } return $ value ; }
Join different values referenced into a map recursively

@param $key
@param $value
@param int $level
@return string
Join different values referenced into a map recursively