| 1 |
<?php |
| 2 |
|
| 3 |
namespace FlyWP\StaticSite\Engine\Discovery; |
| 4 |
|
| 5 |
/** |
| 6 |
* One URL that the engine must fetch. |
| 7 |
* |
| 8 |
* @since 1.8.0 |
| 9 |
*/ |
| 10 |
class DiscoveredUrl { |
| 11 |
|
| 12 |
/** |
| 13 |
* Absolute URL. |
| 14 |
* |
| 15 |
* @var string |
| 16 |
*/ |
| 17 |
public $url; |
| 18 |
|
| 19 |
/** |
| 20 |
* Kind: home, post, page, cpt, term, author, archive, pagination, feed, sitemap, asset or file. |
| 21 |
* |
| 22 |
* @var string |
| 23 |
*/ |
| 24 |
public $kind; |
| 25 |
|
| 26 |
/** |
| 27 |
* Object type: post, term, user or null. |
| 28 |
* |
| 29 |
* @var string|null |
| 30 |
*/ |
| 31 |
public $object_type; |
| 32 |
|
| 33 |
/** |
| 34 |
* Object ID. |
| 35 |
* |
| 36 |
* @var int|null |
| 37 |
*/ |
| 38 |
public $object_id; |
| 39 |
|
| 40 |
/** |
| 41 |
* Last change time, Y-m-d H:i:s GMT. Null when it is not known. |
| 42 |
* |
| 43 |
* @var string|null |
| 44 |
*/ |
| 45 |
public $modified_gmt; |
| 46 |
|
| 47 |
/** |
| 48 |
* @param string $url Absolute URL. |
| 49 |
* @param string $kind URL kind. |
| 50 |
* @param string|null $object_type Object type. |
| 51 |
* @param int|null $object_id Object ID. |
| 52 |
* @param string|null $modified_gmt Last change time in GMT. |
| 53 |
*/ |
| 54 |
public function __construct( $url, $kind, $object_type = null, $object_id = null, $modified_gmt = null ) { |
| 55 |
$this->url = $url; |
| 56 |
$this->kind = $kind; |
| 57 |
$this->object_type = $object_type; |
| 58 |
$this->object_id = null === $object_id ? null : (int) $object_id; |
| 59 |
$this->modified_gmt = $modified_gmt ? $modified_gmt : null; |
| 60 |
} |
| 61 |
} |
| 62 |
|