PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
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 / llms-txt / domain / available-posts / data-provider / available-posts-data.php

available-posts-data.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/llms-txt/domain/available-posts/data-provider/available-posts-data.php

43 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4 // phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded -- Needed in the folder structure.
5 namespace Yoast\WP\SEO\Llms_Txt\Domain\Available_Posts\Data_Provider;
6
7 use Yoast\WP\SEO\Llms_Txt\Domain\Content_Types\Content_Type_Entry;
8
9 /**
10 * Domain object that represents a Available Posts data record.
11 */
12 class Available_Posts_Data implements Data_Interface {
13
14 /**
15 * The content type entry.
16 *
17 * @var Content_Type_Entry
18 */
19 private $content_type_entry;
20
21 /**
22 * The constructor.
23 *
24 * @param Content_Type_Entry $content_type_entry The content type entry.
25 */
26 public function __construct( Content_Type_Entry $content_type_entry ) {
27 $this->content_type_entry = $content_type_entry;
28 }
29
30 /**
31 * The array representation of this domain object.
32 *
33 * @return array<string|float|int|string[]>
34 */
35 public function to_array(): array {
36 return [
37 'id' => $this->content_type_entry->get_id(),
38 'title' => $this->content_type_entry->get_title(),
39 'slug' => $this->content_type_entry->get_slug(),
40 ];
41 }
42 }
43