src/Graviton/DocumentBundle/Serializer/Handler/HashHandler.php
public function deserializeHashFromJson(
        JsonDeserializationVisitor $visitor,
        array $data,
        array $type,
        Context $context
    ) {
        $currentPath = $context->getCurrentPath();
        $currentRequestContent = $this->getCurrentRequestContent();
        $dataObj = null;

        if (!is_null($currentRequestContent)) {
            $dataObj = $currentRequestContent;
            foreach ($currentPath as $pathElement) {
                if (isset($dataObj->{$pathElement})) {
                    $dataObj = $dataObj->{$pathElement};
                } else {
                    $dataObj = null;
                    break;
                }
            }
        }

        if (!is_null($dataObj)) {
            if ($this->isSequentialArrayCase($dataObj, $data)) {
                $dataObj = $dataObj[$this->getLocationCounter($currentPath)];
            }

            $data = $dataObj;
        }

        return new Hash($visitor->visitArray((array) $data, $type, $context));
    }
public function deserializeHashFromJson(
        JsonDeserializationVisitor $visitor,
        array $data,
        array $type,
        Context $context
    ) {
        $currentPath = $context->getCurrentPath();
        $currentRequestContent = $this->getCurrentRequestContent();
        $dataObj = null;

        if (!is_null($currentRequestContent)) {
            $dataObj = $currentRequestContent;
            foreach ($currentPath as $pathElement) {
                if (isset($dataObj->{$pathElement})) {
                    $dataObj = $dataObj->{$pathElement};
                } else {
                    $dataObj = null;
                    break;
                }
            }
        }

        if (!is_null($dataObj)) {
            if ($this->isSequentialArrayCase($dataObj, $data)) {
                $dataObj = $dataObj[$this->getLocationCounter($currentPath)];
            }

            $data = $dataObj;
        }

        return new Hash($visitor->visitArray((array) $data, $type, $context));
    }
public function deserializeHashFromJson ( JsonDeserializationVisitor $ visitor , array $ data , array $ type , Context $ context ) { $ currentPath = $ context -> getCurrentPath ( ) ; $ currentRequestContent = $ this -> getCurrentRequestContent ( ) ; $ dataObj = null ; if ( ! is_null ( $ currentRequestContent ) ) { $ dataObj = $ currentRequestContent ; foreach ( $ currentPath as $ pathElement ) { if ( isset ( $ dataObj -> { $ pathElement } ) ) { $ dataObj = $ dataObj -> { $ pathElement } ; } else { $ dataObj = null ; break ; } } } if ( ! is_null ( $ dataObj ) ) { if ( $ this -> isSequentialArrayCase ( $ dataObj , $ data ) ) { $ dataObj = $ dataObj [ $ this -> getLocationCounter ( $ currentPath ) ] ; } $ data = $ dataObj ; } return new Hash ( $ visitor -> visitArray ( ( array ) $ data , $ type , $ context ) ) ; }
Deserialize Hash object

@param JsonDeserializationVisitor $visitor Visitor
@param array                      $data    Data
@param array                      $type    Type
@param Context                    $context Context
@return Hash
Deserialize Hash object