diff --git a/src/Request/StoriesRequest.php b/src/Request/StoriesRequest.php index 1a2d024..260b258 100644 --- a/src/Request/StoriesRequest.php +++ b/src/Request/StoriesRequest.php @@ -65,6 +65,7 @@ public function __construct( public SlugCollection $bySlugs = new SlugCollection(), public ?StoryLevel $level = null, public ?bool $isStartpage = null, + public ?string $fallbackLanguage = null, public ?string $contentType = null, ) { Assert::stringNotEmpty($language); @@ -96,6 +97,7 @@ public function __construct( * updated_at_lt?: string, * level?: int, * is_startpage?: bool, + * fallback_lang?: string, * content_type?: string, * } */ @@ -188,6 +190,10 @@ public function toArray(): array $array['is_startpage'] = $this->isStartpage ? 1 : 0; } + if (null !== $this->fallbackLanguage) { + $array['fallback_lang'] = $this->fallbackLanguage; + } + if (null !== $this->contentType) { $array['content_type'] = $this->contentType; } diff --git a/src/Request/StoryRequest.php b/src/Request/StoryRequest.php index b241b8f..3718d70 100644 --- a/src/Request/StoryRequest.php +++ b/src/Request/StoryRequest.php @@ -29,6 +29,7 @@ public function __construct( public ?Version $version = null, public RelationCollection $withRelations = new RelationCollection(), public ResolveLinks $resolveLinks = new ResolveLinks(), + public ?string $fallbackLanguage = null, ) { Assert::stringNotEmpty($language); } @@ -40,6 +41,7 @@ public function __construct( * resolve_relations?: string, * resolve_links?: string, * resolve_links_level?: int, + * fallback_lang?: string, * } */ public function toArray(): array @@ -61,6 +63,10 @@ public function toArray(): array $array['resolve_links_level'] = $this->resolveLinks->level->value; } + if (null !== $this->fallbackLanguage) { + $array['fallback_lang'] = $this->fallbackLanguage; + } + return $array; } }