public function __construct($data, DrPublishApiClient $dpClient)
 {
     $this->data = $data;
     $this->dpClient = $dpClient;
     $this->setMedium($dpClient->getMedium());
     $this->buildArticleXmlContentElements();
     self::$imagePublishUrl = $this->data->service->imagePublishUrl;
     self::$imageServiceUrl = $this->data->service->imageServiceUrl;
 }
 public function resize($type)
 {
     $currentSrc = $this->getAttribute('src');
     try {
         $properties = DrPublishApiClient::resizeImage($currentSrc, $type, DrPublishApiClientArticle::getImageServiceUrl(), DrPublishApiClientArticle::getImagePublishUrl());
     } catch (DrPublishApiClientException $e) {
         throw $e;
     }
     $this->setAttribute('src', $properties['src']);
     if (array_key_exists('width', $properties)) {
         $this->setAttribute('width', $properties['width']);
     }
     if (array_key_exists('height', $properties)) {
         $this->setAttribute('height', $properties['height']);
     }
     return $this;
 }