Admin
4 years ago
ApprovedDirectoriesException.php
4 years ago
Register.php
4 years ago
StoredUrl.php
4 years ago
Synchronize.php
1 year ago
StoredUrl.php
70 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories; |
| 4 | |
| 5 | /** |
| 6 | * Representation of an approved directory URL, bundling the ID and URL in a single entity. |
| 7 | */ |
| 8 | class StoredUrl { |
| 9 | /** |
| 10 | * The approved directory ID. |
| 11 | * |
| 12 | * @var int |
| 13 | */ |
| 14 | private $id; |
| 15 | |
| 16 | /** |
| 17 | * The approved directory URL. |
| 18 | * |
| 19 | * @var string |
| 20 | */ |
| 21 | private $url; |
| 22 | |
| 23 | /** |
| 24 | * If the individual rule is enabled or disabled. |
| 25 | * |
| 26 | * @var bool |
| 27 | */ |
| 28 | private $enabled; |
| 29 | |
| 30 | /** |
| 31 | * Sets up the approved directory rule. |
| 32 | * |
| 33 | * @param int $id The approved directory ID. |
| 34 | * @param string $url The approved directory URL. |
| 35 | * @param bool $enabled Indicates if the approved directory rule is enabled. |
| 36 | */ |
| 37 | public function __construct( int $id, string $url, bool $enabled ) { |
| 38 | $this->id = $id; |
| 39 | $this->url = $url; |
| 40 | $this->enabled = $enabled; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Supplies the ID of the approved directory. |
| 45 | * |
| 46 | * @return int |
| 47 | */ |
| 48 | public function get_id(): int { |
| 49 | return $this->id; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Supplies the approved directory URL. |
| 54 | * |
| 55 | * @return string |
| 56 | */ |
| 57 | public function get_url(): string { |
| 58 | return $this->url; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Indicates if this rule is enabled or not (rules can be temporarily disabled). |
| 63 | * |
| 64 | * @return bool |
| 65 | */ |
| 66 | public function is_enabled(): bool { |
| 67 | return $this->enabled; |
| 68 | } |
| 69 | } |
| 70 |