| 1 |
<?php |
| 2 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 3 |
namespace Yoast\WP\SEO\Schema_Aggregator\Domain; |
| 4 |
|
| 5 |
/** |
| 6 |
* Class to contain the count of indexables for a specific post type. |
| 7 |
*/ |
| 8 |
class Indexable_Count { |
| 9 |
|
| 10 |
/** |
| 11 |
* The count of indexables. |
| 12 |
* |
| 13 |
* @var int |
| 14 |
*/ |
| 15 |
private $count; |
| 16 |
|
| 17 |
/** |
| 18 |
* The post type. |
| 19 |
* |
| 20 |
* @var string |
| 21 |
*/ |
| 22 |
private $post_type; |
| 23 |
|
| 24 |
/** |
| 25 |
* Constructor for Indexable_Count. |
| 26 |
* |
| 27 |
* @param string $post_type The post type. |
| 28 |
* @param int $count The count of indexables. |
| 29 |
*/ |
| 30 |
public function __construct( string $post_type, int $count ) { |
| 31 |
$this->post_type = $post_type; |
| 32 |
$this->count = $count; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Gets the count of indexables. |
| 37 |
* |
| 38 |
* @return int The count of indexables. |
| 39 |
*/ |
| 40 |
public function get_count(): int { |
| 41 |
return $this->count; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Gets the post type. |
| 46 |
* |
| 47 |
* @return string The post type. |
| 48 |
*/ |
| 49 |
public function get_post_type(): string { |
| 50 |
return $this->post_type; |
| 51 |
} |
| 52 |
} |
| 53 |
|