Skip to content

Commit 309f736

Browse files
committed
Extract options() to be consistent with other filters.
1 parent 8dd80b1 commit 309f736

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/Query/Scopes/Filters/Blueprint.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ public static function title()
1414

1515
public function fieldItems()
1616
{
17-
$options = $this->blueprints()->mapWithKeys(function ($blueprint) {
18-
return [$blueprint->handle() => $blueprint->title()];
19-
})->all();
20-
2117
return [
2218
'blueprint' => [
2319
'type' => 'select',
24-
'options' => $options,
20+
'options' => $this->options()->all(),
2521
'placeholder' => __('Blueprint'),
2622
],
2723
];
@@ -46,4 +42,11 @@ public function blueprints()
4642
{
4743
return Collection::findByHandle($this->context['collection'])->entryBlueprints();
4844
}
45+
46+
protected function options()
47+
{
48+
return $this->blueprints()->mapWithKeys(function ($blueprint) {
49+
return [$blueprint->handle() => $blueprint->title()];
50+
});
51+
}
4952
}

0 commit comments

Comments
 (0)