private function deserializeImage(GraphicQuestion $graphicQuestion, array $imageData)
    {
        $image = $graphicQuestion->getImage() ?: new Image();

        $this->sipe('id', 'setUuid', $imageData, $image);
        $this->sipe('type', 'setType', $imageData, $image);
        $this->sipe('id', 'setTitle', $imageData, $image);
        $this->sipe('width', 'setWidth', $imageData, $image);
        $this->sipe('height', 'setHeight', $imageData, $image);

        $objectClass = get_class($graphicQuestion);
        $objectUuid = $graphicQuestion->getQuestion() ? $graphicQuestion->getQuestion()->getUuid() : null;
        $title = $graphicQuestion->getQuestion() ? $graphicQuestion->getQuestion()->getTitle() : null;

        $typeParts = explode('/', $imageData['type']);

        if (isset($imageData['data'])) {
            $imageName = "{$imageData['id']}.{$typeParts[1]}";
            $publicFile = $this->fileUtils->createFileFromData(
                $imageData['data'],
                $imageName,
                $objectClass,
                $objectUuid,
                $title,
                $objectClass
            );

            if ($publicFile) {
                $image->setUrl($publicFile->getUrl());
            }
        } elseif (isset($imageData['url'])) {
            $image->setUrl($imageData['url']);
        }

        $graphicQuestion->setImage($image);
    }
private function deserializeImage(GraphicQuestion $graphicQuestion, array $imageData)
    {
        $image = $graphicQuestion->getImage() ?: new Image();

        $this->sipe('id', 'setUuid', $imageData, $image);
        $this->sipe('type', 'setType', $imageData, $image);
        $this->sipe('id', 'setTitle', $imageData, $image);
        $this->sipe('width', 'setWidth', $imageData, $image);
        $this->sipe('height', 'setHeight', $imageData, $image);

        $objectClass = get_class($graphicQuestion);
        $objectUuid = $graphicQuestion->getQuestion() ? $graphicQuestion->getQuestion()->getUuid() : null;
        $title = $graphicQuestion->getQuestion() ? $graphicQuestion->getQuestion()->getTitle() : null;

        $typeParts = explode('/', $imageData['type']);

        if (isset($imageData['data'])) {
            $imageName = "{$imageData['id']}.{$typeParts[1]}";
            $publicFile = $this->fileUtils->createFileFromData(
                $imageData['data'],
                $imageName,
                $objectClass,
                $objectUuid,
                $title,
                $objectClass
            );

            if ($publicFile) {
                $image->setUrl($publicFile->getUrl());
            }
        } elseif (isset($imageData['url'])) {
            $image->setUrl($imageData['url']);
        }

        $graphicQuestion->setImage($image);
    }
private function deserializeImage ( GraphicQuestion $ graphicQuestion , array $ imageData ) { $ image = $ graphicQuestion -> getImage ( ) ? : new Image ( ) ; $ this -> sipe ( 'id' , 'setUuid' , $ imageData , $ image ) ; $ this -> sipe ( 'type' , 'setType' , $ imageData , $ image ) ; $ this -> sipe ( 'id' , 'setTitle' , $ imageData , $ image ) ; $ this -> sipe ( 'width' , 'setWidth' , $ imageData , $ image ) ; $ this -> sipe ( 'height' , 'setHeight' , $ imageData , $ image ) ; $ objectClass = get_class ( $ graphicQuestion ) ; $ objectUuid = $ graphicQuestion -> getQuestion ( ) ? $ graphicQuestion -> getQuestion ( ) -> getUuid ( ) : null ; $ title = $ graphicQuestion -> getQuestion ( ) ? $ graphicQuestion -> getQuestion ( ) -> getTitle ( ) : null ; $ typeParts = explode ( '/' , $ imageData [ 'type' ] ) ; if ( isset ( $ imageData [ 'data' ] ) ) { $ imageName = "{$imageData['id']}.{$typeParts[1]}" ; $ publicFile = $ this -> fileUtils -> createFileFromData ( $ imageData [ 'data' ] , $ imageName , $ objectClass , $ objectUuid , $ title , $ objectClass ) ; if ( $ publicFile ) { $ image -> setUrl ( $ publicFile -> getUrl ( ) ) ; } } elseif ( isset ( $ imageData [ 'url' ] ) ) { $ image -> setUrl ( $ imageData [ 'url' ] ) ; } $ graphicQuestion -> setImage ( $ image ) ; }
Deserializes the Question image.

@param GraphicQuestion $graphicQuestion
@param array           $imageData
Deserializes the Question image .