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

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