| 1 |
<?php |
| 2 |
|
| 3 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 4 |
namespace Yoast\WP\SEO\Dashboard\Domain\Data_Provider; |
| 5 |
|
| 6 |
/** |
| 7 |
* Object representation of the request parameters. |
| 8 |
*/ |
| 9 |
abstract class Parameters { |
| 10 |
|
| 11 |
/** |
| 12 |
* The start date. |
| 13 |
* |
| 14 |
* @var string |
| 15 |
*/ |
| 16 |
private $start_date; |
| 17 |
|
| 18 |
/** |
| 19 |
* The end date. |
| 20 |
* |
| 21 |
* @var string |
| 22 |
*/ |
| 23 |
private $end_date; |
| 24 |
|
| 25 |
/** |
| 26 |
* The amount of results. |
| 27 |
* |
| 28 |
* @var int |
| 29 |
*/ |
| 30 |
private $limit = 0; |
| 31 |
|
| 32 |
/** |
| 33 |
* The compare start date. |
| 34 |
* |
| 35 |
* @var string |
| 36 |
*/ |
| 37 |
private $compare_start_date; |
| 38 |
|
| 39 |
/** |
| 40 |
* The compare end date. |
| 41 |
* |
| 42 |
* @var string |
| 43 |
*/ |
| 44 |
private $compare_end_date; |
| 45 |
|
| 46 |
/** |
| 47 |
* Getter for the start date. |
| 48 |
* |
| 49 |
* @return string |
| 50 |
*/ |
| 51 |
public function get_start_date(): string { |
| 52 |
return $this->start_date; |
| 53 |
} |
| 54 |
|
| 55 |
/** |
| 56 |
* Getter for the end date. |
| 57 |
* The date format should be Y-M-D. |
| 58 |
* |
| 59 |
* @return string |
| 60 |
*/ |
| 61 |
public function get_end_date(): string { |
| 62 |
return $this->end_date; |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Getter for the result limit. |
| 67 |
* |
| 68 |
* @return int |
| 69 |
*/ |
| 70 |
public function get_limit(): int { |
| 71 |
return $this->limit; |
| 72 |
} |
| 73 |
|
| 74 |
/** |
| 75 |
* Getter for the compare start date. |
| 76 |
* |
| 77 |
* @return string |
| 78 |
*/ |
| 79 |
public function get_compare_start_date(): ?string { |
| 80 |
return $this->compare_start_date; |
| 81 |
} |
| 82 |
|
| 83 |
/** |
| 84 |
* Getter for the compare end date. |
| 85 |
* The date format should be Y-M-D. |
| 86 |
* |
| 87 |
* @return string |
| 88 |
*/ |
| 89 |
public function get_compare_end_date(): ?string { |
| 90 |
return $this->compare_end_date; |
| 91 |
} |
| 92 |
|
| 93 |
/** |
| 94 |
* The start date setter. |
| 95 |
* |
| 96 |
* @param string $start_date The start date. |
| 97 |
* |
| 98 |
* @return void |
| 99 |
*/ |
| 100 |
public function set_start_date( string $start_date ): void { |
| 101 |
$this->start_date = $start_date; |
| 102 |
} |
| 103 |
|
| 104 |
/** |
| 105 |
* The end date setter. |
| 106 |
* |
| 107 |
* @param string $end_date The end date. |
| 108 |
* |
| 109 |
* @return void |
| 110 |
*/ |
| 111 |
public function set_end_date( string $end_date ): void { |
| 112 |
$this->end_date = $end_date; |
| 113 |
} |
| 114 |
|
| 115 |
/** |
| 116 |
* The result limit. |
| 117 |
* |
| 118 |
* @param int $limit The result limit. |
| 119 |
* @return void |
| 120 |
*/ |
| 121 |
public function set_limit( int $limit ): void { |
| 122 |
$this->limit = $limit; |
| 123 |
} |
| 124 |
|
| 125 |
/** |
| 126 |
* The compare start date setter. |
| 127 |
* |
| 128 |
* @param string $compare_start_date The compare start date. |
| 129 |
* |
| 130 |
* @return void |
| 131 |
*/ |
| 132 |
public function set_compare_start_date( string $compare_start_date ): void { |
| 133 |
$this->compare_start_date = $compare_start_date; |
| 134 |
} |
| 135 |
|
| 136 |
/** |
| 137 |
* The compare end date setter. |
| 138 |
* |
| 139 |
* @param string $compare_end_date The compare end date. |
| 140 |
* |
| 141 |
* @return void |
| 142 |
*/ |
| 143 |
public function set_compare_end_date( string $compare_end_date ): void { |
| 144 |
$this->compare_end_date = $compare_end_date; |
| 145 |
} |
| 146 |
} |
| 147 |
|