| 1 | <?php |
||
| 14 | class DiscountCode |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @JMS\Type("string") |
||
| 18 | * @ORM\Column(type="string") |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $code; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @JMS\Type("string") |
||
| 25 | * @ORM\Column(type="string") |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $displayName; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @JMS\Type("Object") |
||
| 32 | * @ORM\Column(type="json_object") |
||
| 33 | * @var DiscountTypeInterface |
||
| 34 | */ |
||
| 35 | private $discountType; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * DiscountCode constructor. |
||
| 39 | * @param $code |
||
| 40 | * @param $displayName |
||
| 41 | * @param $discountType |
||
| 42 | */ |
||
| 43 | 4 | public function __construct(string $code, string $displayName, DiscountTypeInterface $discountType) |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 1 | public function getCode(): string |
|
| 57 | |||
| 58 | /** |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | public function getDisplayName(): string |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return DiscountTypeInterface |
||
| 68 | */ |
||
| 69 | public function getDiscountType(): DiscountTypeInterface |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @param Basket $to |
||
| 76 | * @return Price |
||
| 77 | */ |
||
| 78 | 3 | public function apply(Basket $to): Price |
|
| 82 | } |