Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-277: Replace DTO with array #243

Merged
merged 1 commit into from
May 22, 2024
Merged
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
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;
BartoszWojdalowicz marked this conversation as resolved.
Show resolved Hide resolved
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
Loading