custom/plugins/WodkaHoverOnListingSW6/src/Services/HoverOnListingConfiguration.php line 7

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace WodkaHoverOnListingSW6\Services;
  3. use Shopware\Core\Framework\Struct\Struct;
  4. class HoverOnListingConfiguration extends Struct
  5. {
  6.     /**
  7.      * @var bool
  8.      */
  9.     private bool $active;
  10.     /**
  11.      * @var bool
  12.      */
  13.     private bool $useOnHoverColor;
  14.     /**
  15.      * @var bool
  16.      */
  17.     private bool $clickableProductBlock;
  18.     /**
  19.      * @var string
  20.      */
  21.     private string $onHoverItemColor;
  22.     /**
  23.      * @var bool
  24.      */
  25.     private bool $imageSliderActive;
  26.     /**
  27.      * @var bool
  28.      */
  29.     private bool $activeListingGrid;
  30.     /**
  31.      * @var bool
  32.      */
  33.     private bool $activeFlipDescription;
  34.     /**
  35.      * @var string|null
  36.      */
  37.     private ?string $navigationDotsPosition;
  38.     /**
  39.      * @var string|null
  40.      */
  41.     private ?string $navigationArrowsPosition;
  42.     /**
  43.      * @var bool
  44.      */
  45.     private bool $activeImageHover;
  46.     /**
  47.      * @var string|null
  48.      */
  49.     private ?string $imageHoverEffects;
  50.     /**
  51.      * @var string
  52.      */
  53.     private string $navigationArrowsColor;
  54.     /**
  55.      * @var string
  56.      */
  57.     private string $activeNavigationDotColor;
  58.     /**
  59.      * @var string
  60.      */
  61.     private string $inactiveNavigationDotColor;
  62.     /**
  63.      * @var bool
  64.      */
  65.     private bool $autoplay;
  66.     public function __construct(array $data)
  67.     {
  68.         $this->active $data['active'] ?? false;
  69.         $this->useOnHoverColor $data['useOnHoverColor'] ?? false;
  70.         $this->clickableProductBlock $data['clickableProductBlock'] ?? false;
  71.         $this->onHoverItemColor $data['onHoverItemColor'] ?? '';
  72.         $this->activeFlipDescription $data['activeFlipDescription'] ?? false;
  73.         $this->imageSliderActive $data['imageSliderActive'] ?? false;
  74.         $this->activeListingGrid $data['activeListingGrid'] ?? false;
  75.         $this->navigationDotsPosition $data['navigationDotsPosition'] ?? null;
  76.         $this->navigationArrowsPosition $data['navigationArrowsPosition'] ?? null;
  77.         $this->activeImageHover $data['activeImageHover'] ?? false;
  78.         $this->imageHoverEffects $data['imageHoverEffects'] ?? 'zoom';
  79.         $this->navigationArrowsColor $data['navigationArrowsColor'] ?? '';
  80.         $this->activeNavigationDotColor $data['activeNavigationDotColor'] ?? '';
  81.         $this->inactiveNavigationDotColor $data['inactiveNavigationDotColor'] ?? '';
  82.         $this->autoplay $data['autoplay'] ?? false;
  83.     }
  84.     /**
  85.      * @return bool
  86.      */
  87.     public function isActive(): bool
  88.     {
  89.         return $this->active;
  90.     }
  91.     /**
  92.      * @return bool
  93.      */
  94.     public function useOnHoverColor(): bool
  95.     {
  96.         return $this->useOnHoverColor;
  97.     }
  98.     /**
  99.      * @return bool
  100.      */
  101.     public function clickableProductBlock(): bool
  102.     {
  103.         return $this->clickableProductBlock;
  104.     }
  105.     /**
  106.      * @return string
  107.      */
  108.     public function getOnHoverItemColor(): string
  109.     {
  110.         return $this->onHoverItemColor;
  111.     }
  112.     /**
  113.      * @return bool
  114.      */
  115.     public function isActiveFlipDescription(): bool
  116.     {
  117.         return $this->activeFlipDescription;
  118.     }
  119.     /**
  120.      * @return bool
  121.      */
  122.     public function isImageSliderActive(): bool
  123.     {
  124.         return $this->imageSliderActive;
  125.     }
  126.     /**
  127.      * @return bool
  128.      */
  129.     public function isActiveListingGrid(): bool
  130.     {
  131.         return $this->activeListingGrid;
  132.     }
  133.     /**
  134.      * @return string|null
  135.      */
  136.     public function getNavigationDotsPosition(): ?string
  137.     {
  138.         return $this->navigationDotsPosition;
  139.     }
  140.     /**
  141.      * @return string|null
  142.      */
  143.     public function getNavigationArrowsPosition(): ?string
  144.     {
  145.         return $this->navigationArrowsPosition;
  146.     }
  147.     /**
  148.      * @return bool
  149.      */
  150.     public function isActiveImageHover(): bool
  151.     {
  152.         return $this->activeImageHover;
  153.     }
  154.     /**
  155.      * @return string|null
  156.      */
  157.     public function getImageHoverEffects(): ?string
  158.     {
  159.         return $this->imageHoverEffects;
  160.     }
  161.     /**
  162.      * @return string
  163.      */
  164.     public function getNavigationArrowsColor(): string
  165.     {
  166.         return $this->navigationArrowsColor;
  167.     }
  168.     /**
  169.      * @return string
  170.      */
  171.     public function getActiveNavigationDotColor(): string
  172.     {
  173.         return $this->activeNavigationDotColor;
  174.     }
  175.     /**
  176.      * @return string
  177.      */
  178.     public function getInactiveNavigationDotColor(): string
  179.     {
  180.         return $this->inactiveNavigationDotColor;
  181.     }
  182.     /**
  183.      * @return bool
  184.      */
  185.     public function isAutoplay(): bool
  186.     {
  187.         return $this->autoplay;
  188.     }
  189. }