src/Entity/Hydrator/Strategy/HttploadStrategy.php
public function hydrate($value, $data = null, $object = null)
    {
        $organizationImageEntity = $value;
        // @TODO: has the Object already an Image, than take this

        if (is_string($value)) {
            $client = new HttpClient($value, array('sslverifypeer' => false));
            $response = $client->send();
            $file = new GridFSFile();
            $file->setBytes($response->getBody());

            /* @var OrganizationImageEntity $organizationImageEntity */
            $organizationImageEntity = $this->repository->create();
            $organizationImageEntity->setType($response->getHeaders()->get('Content-Type')->getFieldValue());
            
            $organizationImageEntity->setFile($file);
        }
        
        return $organizationImageEntity;
    }
public function hydrate($value, $data = null, $object = null)
    {
        $organizationImageEntity = $value;
        // @TODO: has the Object already an Image, than take this

        if (is_string($value)) {
            $client = new HttpClient($value, array('sslverifypeer' => false));
            $response = $client->send();
            $file = new GridFSFile();
            $file->setBytes($response->getBody());

            /* @var OrganizationImageEntity $organizationImageEntity */
            $organizationImageEntity = $this->repository->create();
            $organizationImageEntity->setType($response->getHeaders()->get('Content-Type')->getFieldValue());
            
            $organizationImageEntity->setFile($file);
        }
        
        return $organizationImageEntity;
    }
@param mixed $value
@param null  $data
@param null  $object

@return mixed