| Total Complexity | 13 |
| Total Lines | 117 |
| 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 | /** |
||
| 32 | * @var \DateTime |
||
| 33 | */ |
||
| 34 | private $createdAt; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var \DateTime |
||
| 38 | */ |
||
| 39 | private $updatedAt; |
||
| 40 | |||
| 41 | public function __construct() |
||
| 42 | { |
||
| 43 | $this->__imagesAwareTraitConstruct(); |
||
| 44 | $this->__productsAwareTraitConstruct(); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function __toString(): string |
||
| 51 | { |
||
| 52 | return (string) $this->getName(); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | public function getId(): ?int |
||
| 59 | { |
||
| 60 | return $this->id; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | public function getCode(): ?string |
||
| 67 | { |
||
| 68 | return $this->code; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param string $code |
||
| 73 | */ |
||
| 74 | public function setCode(?string $code): void |
||
| 75 | { |
||
| 76 | $this->code = $code; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * {@inheritdoc} |
||
| 81 | */ |
||
| 82 | public function getName(): ?string |
||
| 83 | { |
||
| 84 | return $this->name; |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * {@inheritdoc} |
||
| 89 | */ |
||
| 90 | public function setName(?string $name): void |
||
| 91 | { |
||
| 92 | $this->name = $name; |
||
| 93 | } |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @return \DateTime |
||
| 97 | */ |
||
| 98 | public function getCreatedAt(): \DateTime |
||
| 99 | { |
||
| 100 | return $this->createdAt; |
||
| 101 | } |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @return \DateTime |
||
| 105 | */ |
||
| 106 | public function getUpdatedAt(): \DateTime |
||
| 107 | { |
||
| 108 | return $this->updatedAt; |
||
| 109 | } |
||
| 110 | |||
| 111 | public function addProduct(ProductInterface $product): void |
||
| 116 | } |
||
| 117 | } |
||
| 118 | |||
| 119 | public function removeProduct(ProductInterface $product): void |
||
| 124 | } |
||
| 125 | } |
||
| 126 | } |
||
| 127 |