| 1 | <?php |
||
| 10 | class Product |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var SKU |
||
| 14 | */ |
||
| 15 | private $sku; |
||
| 16 | /** |
||
| 17 | * @var Slug |
||
| 18 | */ |
||
| 19 | private $slug; |
||
| 20 | /** |
||
| 21 | * @var Content |
||
| 22 | */ |
||
| 23 | private $content; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Creates a new Product basic class instance. |
||
| 27 | * |
||
| 28 | * @param SKU $sku A unique identifier for the product (e.g. "fancy-short-1") |
||
| 29 | * @param Slug $slug A human-readable, descriptive URL fragment for the product (e.g. |
||
| 30 | * "fancy-t-shirt-1-with-ice-cream-pooping-unicorn") |
||
| 31 | * @param Content $content A product content model |
||
| 32 | * |
||
| 33 | */ |
||
| 34 | 4 | public function __construct(SKU $sku, Slug $slug, Content $content) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Get the unique identifier for the product (e.g. "fancy-short-1") |
||
| 43 | * |
||
| 44 | * @return SKU |
||
| 45 | */ |
||
| 46 | 1 | public function getSku() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Get the human-readable, descriptive URL fragment for the product (e.g. |
||
| 53 | * "fancy-t-shirt-1-with-ice-cream-pooping-unicorn") |
||
| 54 | * |
||
| 55 | * @return Slug |
||
| 56 | */ |
||
| 57 | public function getSlug() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Get the title of the product (e.g. "Fancy T-Shirt No. 1") |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function getTitle() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Get a short description text of the product (e.g. "The first edition of our fancy T-Shirt with a unicorn pooping |
||
| 74 | * ice cream on the front") |
||
| 75 | * |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | public function getSummaryText() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Get a full product description text |
||
| 85 | * |
||
| 86 | * @return string |
||
| 87 | */ |
||
| 88 | public function getProductDescription() |
||
| 92 | } |