vendor/shopware/core/Content/Media/Aggregate/MediaThumbnail/MediaThumbnailEntity.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Media\Aggregate\MediaThumbnail;
  3. use Shopware\Core\Content\Media\MediaEntity;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Entity;
  5. use Shopware\Core\Framework\DataAbstractionLayer\EntityCustomFieldsTrait;
  6. use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
  7. class MediaThumbnailEntity extends Entity
  8. {
  9.     use EntityIdTrait;
  10.     use EntityCustomFieldsTrait;
  11.     /**
  12.      * @var int
  13.      */
  14.     protected $width;
  15.     /**
  16.      * @var int
  17.      */
  18.     protected $height;
  19.     /**
  20.      * @var string
  21.      */
  22.     protected $url '';
  23.     /**
  24.      * @var string
  25.      */
  26.     protected $mediaId;
  27.     /**
  28.      * @var MediaEntity|null
  29.      */
  30.     protected $media;
  31.     public function getWidth(): int
  32.     {
  33.         return $this->width;
  34.     }
  35.     public function setWidth(int $width): void
  36.     {
  37.         $this->width $width;
  38.     }
  39.     public function getHeight(): int
  40.     {
  41.         return $this->height;
  42.     }
  43.     public function setHeight(int $height): void
  44.     {
  45.         $this->height $height;
  46.     }
  47.     public function getUrl(): string
  48.     {
  49.         return $this->url;
  50.     }
  51.     public function setUrl(string $url): void
  52.     {
  53.         $this->url $url;
  54.     }
  55.     public function getMediaId(): string
  56.     {
  57.         return $this->mediaId;
  58.     }
  59.     public function setMediaId(string $mediaId): void
  60.     {
  61.         $this->mediaId $mediaId;
  62.     }
  63.     public function getMedia(): ?MediaEntity
  64.     {
  65.         return $this->media;
  66.     }
  67.     public function setMedia(MediaEntity $media): void
  68.     {
  69.         $this->media $media;
  70.     }
  71.     public function getIdentifier(): string
  72.     {
  73.         $identifier sprintf('%dx%d'$this->getWidth(), $this->getHeight());
  74.         return $identifier;
  75.     }
  76. }