| Total Complexity | 11 |
| Total Lines | 91 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Brand implements BrandInterface |
||
| 8 | { |
||
| 9 | use ProductsAwareTrait { |
||
| 10 | ProductsAwareTrait::__construct as private __productsAwareTraitConstruct; |
||
| 11 | } |
||
| 12 | use ImagesAwareTrait { |
||
| 13 | ImagesAwareTrait::__construct as private __imagesAwareTraitConstruct; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | protected $id; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string|null |
||
| 23 | */ |
||
| 24 | protected $code; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string|null |
||
| 28 | */ |
||
| 29 | protected $name; |
||
| 30 | |||
| 31 | public function __construct() |
||
| 32 | { |
||
| 33 | $this->__imagesAwareTraitConstruct(); |
||
| 34 | $this->__productsAwareTraitConstruct(); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | public function __toString(): string |
||
| 41 | { |
||
| 42 | return (string) $this->getName(); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritdoc} |
||
| 47 | */ |
||
| 48 | public function getId(): ?int |
||
| 49 | { |
||
| 50 | return $this->id; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function getCode(): ?string |
||
| 57 | { |
||
| 58 | return $this->code; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param string $code |
||
| 63 | */ |
||
| 64 | public function setCode(?string $code): void |
||
| 65 | { |
||
| 66 | $this->code = $code; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * {@inheritdoc} |
||
| 71 | */ |
||
| 72 | public function getName(): ?string |
||
| 73 | { |
||
| 74 | return $this->name; |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * {@inheritdoc} |
||
| 79 | */ |
||
| 80 | public function setName(?string $name): void |
||
| 81 | { |
||
| 82 | $this->name = $name; |
||
| 83 | } |
||
| 84 | |||
| 85 | public function addProduct(ProductInterface $product): void |
||
| 90 | } |
||
| 91 | } |
||
| 92 | |||
| 93 | public function removeProduct(ProductInterface $product): void |
||
| 98 | } |
||
| 99 | } |
||
| 100 | } |
||
| 101 |