| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Promotions\Domain; |
| 4 |
|
| 5 |
/** |
| 6 |
* Abstract class for a promotion. |
| 7 |
*/ |
| 8 |
abstract class Abstract_Promotion implements Promotion_Interface { |
| 9 |
|
| 10 |
/** |
| 11 |
* The promotion name. |
| 12 |
* |
| 13 |
* @var string |
| 14 |
*/ |
| 15 |
private $promotion_name; |
| 16 |
|
| 17 |
/** |
| 18 |
* The time interval in which the promotion is active. |
| 19 |
* |
| 20 |
* @var Time_Interval |
| 21 |
*/ |
| 22 |
private $time_interval; |
| 23 |
|
| 24 |
/** |
| 25 |
* Class constructor. |
| 26 |
* |
| 27 |
* @param string $promotion_name The promotion name. |
| 28 |
* @param Time_Interval $time_interval The time interval in which the promotion is active. |
| 29 |
*/ |
| 30 |
public function __construct( string $promotion_name, Time_Interval $time_interval ) { |
| 31 |
$this->promotion_name = $promotion_name; |
| 32 |
$this->time_interval = $time_interval; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Returns the promotion name. |
| 37 |
* |
| 38 |
* @return string |
| 39 |
*/ |
| 40 |
public function get_promotion_name() { |
| 41 |
return $this->promotion_name; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Returns the time interval in which the promotion is active. |
| 46 |
* |
| 47 |
* @return Time_Interval |
| 48 |
*/ |
| 49 |
public function get_time_interval() { |
| 50 |
return $this->time_interval; |
| 51 |
} |
| 52 |
} |
| 53 |
|