File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ public function __construct(
6161 public ?FirstPublishedAtLt $ firstPublishedAtLt = null ,
6262 public ?UpdatedAtGt $ updatedAtGt = null ,
6363 public ?UpdatedAtLt $ updatedAtLt = null ,
64+ public SlugCollection $ bySlugs = new SlugCollection (),
6465 ) {
6566 Assert::stringNotEmpty ($ language );
6667 Assert::lessThanEq ($ this ->pagination ->perPage , self ::MAX_PER_PAGE );
@@ -168,6 +169,10 @@ public function toArray(): array
168169 $ array ['updated_at_lt ' ] = $ this ->updatedAtLt ->toString ();
169170 }
170171
172+ if ($ this ->bySlugs ->count () > 0 ) {
173+ $ array ['by_slugs ' ] = $ this ->bySlugs ->toString ();
174+ }
175+
171176 return $ array ;
172177 }
173178}
Original file line number Diff line number Diff line change @@ -348,4 +348,22 @@ public function toArrayWithUpdatedAtLt(): void
348348 'updated_at_lt ' => $ expectedDate ,
349349 ], $ request ->toArray ());
350350 }
351+
352+ #[Test]
353+ public function toArrayBySlugs (): void
354+ {
355+ $ request = new StoriesRequest (
356+ bySlugs: new SlugCollection ([
357+ new Slug ('path/* ' ),
358+ new Slug ('another-path/* ' ),
359+ ]),
360+ );
361+
362+ self ::assertSame ([
363+ 'language ' => 'default ' ,
364+ 'page ' => 1 ,
365+ 'per_page ' => 25 ,
366+ 'by_slugs ' => 'path/*,another-path/* ' ,
367+ ], $ request ->toArray ());
368+ }
351369}
You can’t perform that action at this time.
0 commit comments