1<?php 2/** 3 * Copyright since 2007 PrestaShop SA and Contributors 4 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA 5 * 6 * NOTICE OF LICENSE 7 * 8 * This source file is subject to the Open Software License (OSL 3.0) 9 * that is bundled with this package in the file LICENSE.md. 10 * It is also available through the world-wide-web at this URL: 11 * https://opensource.org/licenses/OSL-3.0 12 * If you did not receive a copy of the license and are unable to 13 * obtain it through the world-wide-web, please send an email 14 * to license@prestashop.com so we can send you a copy immediately. 15 * 16 * DISCLAIMER 17 * 18 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 19 * versions in the future. If you wish to customize PrestaShop for your 20 * needs please refer to https://devdocs.prestashop.com/ for more information. 21 * 22 * @author PrestaShop SA and Contributors <contact@prestashop.com> 23 * @copyright Since 2007 PrestaShop SA and Contributors 24 * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) 25 */ 26 27declare(strict_types=1); 28 29namespace PrestaShop\PrestaShop\Core\Domain\Product\AttributeGroup\Attribute\QueryResult; 30 31class Attribute 32{ 33 /** 34 * @var int 35 */ 36 private $attributeId; 37 38 /** 39 * @var int 40 */ 41 private $position; 42 43 /** 44 * @var string 45 */ 46 private $color; 47 48 /** 49 * @var string[] key => value pairs where each key represents language id 50 */ 51 private $localizedNames; 52 53 /** 54 * @param int $attributeId 55 * @param int $position 56 * @param string $color 57 * @param string[] $localizedNames key => value pairs where each key represents language id 58 */ 59 public function __construct( 60 int $attributeId, 61 int $position, 62 string $color, 63 array $localizedNames 64 ) { 65 $this->attributeId = $attributeId; 66 $this->position = $position; 67 $this->color = $color; 68 $this->localizedNames = $localizedNames; 69 } 70 71 /** 72 * @return int 73 */ 74 public function getAttributeId(): int 75 { 76 return $this->attributeId; 77 } 78 79 /** 80 * @return int 81 */ 82 public function getPosition(): int 83 { 84 return $this->position; 85 } 86 87 /** 88 * @return string 89 */ 90 public function getColor(): string 91 { 92 return $this->color; 93 } 94 95 /** 96 * @return string[] 97 */ 98 public function getLocalizedNames(): array 99 { 100 return $this->localizedNames; 101 } 102} 103