Skip to content

Commit

Permalink
Merge pull request #243 from BitBagCommerce/op-277-search-facets-dto
Browse files Browse the repository at this point in the history
OP-277: Replace DTO with array
  • Loading branch information
GracjanJozefczyk committed May 22, 2024
2 parents 166dd8e + 4f94b0c commit 53dfc79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/Form/Type/SearchFacetsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
namespace BitBag\SyliusElasticsearchPlugin\Form\Type;

use BitBag\SyliusElasticsearchPlugin\Facet\RegistryInterface;
use BitBag\SyliusElasticsearchPlugin\Model\SearchFacets;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -56,6 +55,5 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setRequired('facets');
$resolver->setDefault('data_class', SearchFacets::class);
}
}
7 changes: 3 additions & 4 deletions src/Model/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ class Search
{
private ?SearchBox $box;

private ?SearchFacets $facets;
private array $facets = [];

public function __construct()
{
$this->box = new SearchBox();
$this->facets = new SearchFacets();
}

public function getBox(): ?SearchBox
Expand All @@ -34,12 +33,12 @@ public function setBox(?SearchBox $box): void
$this->box = $box;
}

public function getFacets(): ?SearchFacets
public function getFacets(): array
{
return $this->facets;
}

public function setFacets(?SearchFacets $facets): void
public function setFacets(array $facets): void
{
$this->facets = $facets;
}
Expand Down

0 comments on commit 53dfc79

Please sign in to comment.