| 1 |
<?php |
| 2 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 3 |
|
| 4 |
namespace Yoast\WP\SEO\AI\Content_Planner\Domain; |
| 5 |
|
| 6 |
use WP_User; |
| 7 |
|
| 8 |
/** |
| 9 |
* Parameters for a content outline request. |
| 10 |
*/ |
| 11 |
class Content_Outline_Parameters { |
| 12 |
|
| 13 |
/** |
| 14 |
* The user the request is on behalf of. |
| 15 |
* |
| 16 |
* @var WP_User |
| 17 |
*/ |
| 18 |
private $user; |
| 19 |
|
| 20 |
/** |
| 21 |
* The language code. |
| 22 |
* |
| 23 |
* @var string |
| 24 |
*/ |
| 25 |
private $language; |
| 26 |
|
| 27 |
/** |
| 28 |
* The content payload: new_post_metadata, existing_posts, and optional about_page. |
| 29 |
* |
| 30 |
* @var array<string> |
| 31 |
*/ |
| 32 |
private $content; |
| 33 |
|
| 34 |
/** |
| 35 |
* The editor identifier sent as the X-Yst-Cohort header. |
| 36 |
* |
| 37 |
* @var string |
| 38 |
*/ |
| 39 |
private $editor; |
| 40 |
|
| 41 |
/** |
| 42 |
* The constructor. |
| 43 |
* |
| 44 |
* @param WP_User $user The user. |
| 45 |
* @param string $language The language code. |
| 46 |
* @param array<string> $content The content payload. |
| 47 |
* @param string $editor The editor identifier. |
| 48 |
*/ |
| 49 |
public function __construct( WP_User $user, string $language, array $content, string $editor ) { |
| 50 |
$this->user = $user; |
| 51 |
$this->language = $language; |
| 52 |
$this->content = $content; |
| 53 |
$this->editor = $editor; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Returns the user. |
| 58 |
* |
| 59 |
* @return WP_User The user. |
| 60 |
*/ |
| 61 |
public function get_user(): WP_User { |
| 62 |
return $this->user; |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Returns the language code. |
| 67 |
* |
| 68 |
* @return string The language code. |
| 69 |
*/ |
| 70 |
public function get_language(): string { |
| 71 |
return $this->language; |
| 72 |
} |
| 73 |
|
| 74 |
/** |
| 75 |
* Returns the content payload. |
| 76 |
* |
| 77 |
* @return array<string> The content payload. |
| 78 |
*/ |
| 79 |
public function get_content(): array { |
| 80 |
return $this->content; |
| 81 |
} |
| 82 |
|
| 83 |
/** |
| 84 |
* Returns the editor identifier. |
| 85 |
* |
| 86 |
* @return string The editor identifier. |
| 87 |
*/ |
| 88 |
public function get_editor(): string { |
| 89 |
return $this->editor; |
| 90 |
} |
| 91 |
} |
| 92 |
|