PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.6
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.6
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / task-list / domain / data / meta-description-content-item-data.php

meta-description-content-item-data.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.6, at src/task-list/domain/data/meta-description-content-item-data.php

71 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3 namespace Yoast\WP\SEO\Task_List\Domain\Data;
4
5 /**
6 * Value object representing content item data for the improve default meta descriptions task.
7 */
8 class Meta_Description_Content_Item_Data implements Content_Item_Data_Interface {
9
10 /**
11 * The content item ID.
12 *
13 * @var int
14 */
15 private $content_id;
16
17 /**
18 * The content item title.
19 *
20 * @var string
21 */
22 private $title;
23
24 /**
25 * Whether the content item has a custom meta description.
26 *
27 * @var bool
28 */
29 private $has_description;
30
31 /**
32 * Constructs the content item data.
33 *
34 * @param int $content_id The content item ID.
35 * @param string $title The content item title.
36 * @param bool $has_description Whether the content item has a custom meta description.
37 */
38 public function __construct( int $content_id, string $title, bool $has_description ) {
39 $this->content_id = $content_id;
40 $this->title = $title;
41 $this->has_description = $has_description;
42 }
43
44 /**
45 * Returns the content item ID.
46 *
47 * @return int
48 */
49 public function get_content_id(): int {
50 return $this->content_id;
51 }
52
53 /**
54 * Returns the content item title.
55 *
56 * @return string
57 */
58 public function get_title(): string {
59 return $this->title;
60 }
61
62 /**
63 * Returns whether the content item has a custom meta description.
64 *
65 * @return bool
66 */
67 public function has_description(): bool {
68 return $this->has_description;
69 }
70 }
71