Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Request/StoriesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -96,6 +97,7 @@ public function __construct(
* updated_at_lt?: string,
* level?: int,
* is_startpage?: bool,
* fallback_lang?: string,
* content_type?: string,
* }
*/
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions src/Request/StoryRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -40,6 +41,7 @@ public function __construct(
* resolve_relations?: string,
* resolve_links?: string,
* resolve_links_level?: int,
* fallback_lang?: string,
* }
*/
public function toArray(): array
Expand All @@ -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;
}
}
Loading