| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Introductions\Domain; |
| 4 |
|
| 5 |
/** |
| 6 |
* Domain object that holds introduction information. |
| 7 |
*/ |
| 8 |
class Introduction_Item { |
| 9 |
|
| 10 |
/** |
| 11 |
* The ID. |
| 12 |
* |
| 13 |
* @var string |
| 14 |
*/ |
| 15 |
private $id; |
| 16 |
|
| 17 |
/** |
| 18 |
* The priority. |
| 19 |
* |
| 20 |
* @var int |
| 21 |
*/ |
| 22 |
private $priority; |
| 23 |
|
| 24 |
/** |
| 25 |
* Constructs the instance. |
| 26 |
* |
| 27 |
* @param string $id The ID. |
| 28 |
* @param int $priority The priority. |
| 29 |
*/ |
| 30 |
public function __construct( $id, $priority ) { |
| 31 |
$this->id = $id; |
| 32 |
$this->priority = $priority; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Returns an array representation of the data. |
| 37 |
* |
| 38 |
* @return array Returns in an array format. |
| 39 |
*/ |
| 40 |
public function to_array() { |
| 41 |
return [ |
| 42 |
'id' => $this->get_id(), |
| 43 |
'priority' => $this->get_priority(), |
| 44 |
]; |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Returns the ID. |
| 49 |
* |
| 50 |
* @return string |
| 51 |
*/ |
| 52 |
public function get_id() { |
| 53 |
return $this->id; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Returns the requested pagination priority. Higher means earlier. |
| 58 |
* |
| 59 |
* @return int |
| 60 |
*/ |
| 61 |
public function get_priority() { |
| 62 |
return $this->priority; |
| 63 |
} |
| 64 |
} |
| 65 |
|