getUrl() public method

public getUrl ( ) : string
return string
Example #1
0
 /**
  * Get the contacts avatar and return the array of different formats.
  *
  * @return Media
  *
  * @VirtualProperty
  * @SerializedName("avatar")
  * @Groups({"fullContact","partialContact"})
  */
 public function getAvatar()
 {
     if ($this->avatar) {
         return ['id' => $this->avatar->getId(), 'url' => $this->avatar->getUrl(), 'thumbnails' => $this->avatar->getFormats()];
     }
     return;
 }
Example #2
0
 /**
  * Get the accounts logo and return the array of different formats.
  *
  * @return Media
  *
  * @VirtualProperty
  * @SerializedName("logo")
  * @Groups({"fullAccount"})
  */
 public function getLogo()
 {
     if ($this->logo) {
         return ['id' => $this->logo->getId(), 'url' => $this->logo->getUrl(), 'thumbnails' => $this->logo->getFormats()];
     }
     return;
 }
 public function getMediaUrl(Media $media, $dispositionType = null)
 {
     if (!$dispositionType && !($dispositionType = $this->getDispositionTypeByMimeType($media->getMimeType()))) {
         $dispositionType = $this->default;
     }
     $url = $media->getUrl();
     if ($dispositionType === ResponseHeaderBag::DISPOSITION_INLINE) {
         $url .= false === strpos($url, '?') ? '?inline=1' : '&inline=1';
     }
     return $url;
 }