2020use Storyblok \Api \Domain \Value \Field \FieldCollection ;
2121use Storyblok \Api \Domain \Value \Filter \FilterCollection ;
2222use Storyblok \Api \Domain \Value \IdCollection ;
23+ use Storyblok \Api \Domain \Value \QueryParameter \FirstPublishedAtGt ;
24+ use Storyblok \Api \Domain \Value \QueryParameter \FirstPublishedAtLt ;
25+ use Storyblok \Api \Domain \Value \QueryParameter \PublishedAtGt ;
26+ use Storyblok \Api \Domain \Value \QueryParameter \PublishedAtLt ;
27+ use Storyblok \Api \Domain \Value \QueryParameter \UpdatedAtGt ;
28+ use Storyblok \Api \Domain \Value \QueryParameter \UpdatedAtLt ;
2329use Storyblok \Api \Domain \Value \Resolver \RelationCollection ;
2430use Storyblok \Api \Domain \Value \Resolver \ResolveLinks ;
2531use Storyblok \Api \Domain \Value \Slug \Slug ;
@@ -49,6 +55,12 @@ public function __construct(
4955 public ResolveLinks $ resolveLinks = new ResolveLinks (),
5056 public SlugCollection $ excludeSlugs = new SlugCollection (),
5157 public ?Slug $ startsWith = null ,
58+ public ?PublishedAtGt $ publishedAtGt = null ,
59+ public ?PublishedAtLt $ publishedAtLt = null ,
60+ public ?FirstPublishedAtGt $ firstPublishedAtGt = null ,
61+ public ?FirstPublishedAtLt $ firstPublishedAtLt = null ,
62+ public ?UpdatedAtGt $ updatedAtGt = null ,
63+ public ?UpdatedAtLt $ updatedAtLt = null ,
5264 ) {
5365 Assert::stringNotEmpty ($ language );
5466 Assert::lessThanEq ($ this ->pagination ->perPage , self ::MAX_PER_PAGE );
@@ -71,6 +83,12 @@ public function __construct(
7183 * version?: string,
7284 * excluding_slugs?: string,
7385 * starts_with?: string,
86+ * published_at_gt?: string,
87+ * published_at_lt?: string,
88+ * first_published_at_gt?: string,
89+ * first_published_at_lt?: string,
90+ * updated_at_gt?: string,
91+ * updated_at_lt?: string,
7492 * }
7593 */
7694 public function toArray (): array
@@ -126,6 +144,30 @@ public function toArray(): array
126144 $ array ['starts_with ' ] = $ this ->startsWith ->value ;
127145 }
128146
147+ if (null !== $ this ->publishedAtGt ) {
148+ $ array ['published_at_gt ' ] = $ this ->publishedAtGt ->toString ();
149+ }
150+
151+ if (null !== $ this ->publishedAtLt ) {
152+ $ array ['published_at_lt ' ] = $ this ->publishedAtLt ->toString ();
153+ }
154+
155+ if (null !== $ this ->firstPublishedAtGt ) {
156+ $ array ['first_published_at_gt ' ] = $ this ->firstPublishedAtGt ->toString ();
157+ }
158+
159+ if (null !== $ this ->firstPublishedAtLt ) {
160+ $ array ['first_published_at_lt ' ] = $ this ->firstPublishedAtLt ->toString ();
161+ }
162+
163+ if (null !== $ this ->updatedAtGt ) {
164+ $ array ['updated_at_gt ' ] = $ this ->updatedAtGt ->toString ();
165+ }
166+
167+ if (null !== $ this ->updatedAtLt ) {
168+ $ array ['updated_at_lt ' ] = $ this ->updatedAtLt ->toString ();
169+ }
170+
129171 return $ array ;
130172 }
131173}
0 commit comments