Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
Closed
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: 1 addition & 1 deletion Event/ApplyFilterConditionEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Lexik\Bundle\FormFilterBundle\Event;

use Lexik\Bundle\FormFilterBundle\Filter\Condition\ConditionBuilderInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* Event class to compute the WHERE clause from the conditions.
Expand Down
2 changes: 1 addition & 1 deletion Event/GetFilterConditionEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lexik\Bundle\FormFilterBundle\Event;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
use Lexik\Bundle\FormFilterBundle\Filter\Condition\Condition;
use Lexik\Bundle\FormFilterBundle\Filter\Condition\ConditionInterface;
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
Expand Down
2 changes: 1 addition & 1 deletion Event/PrepareEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Lexik\Bundle\FormFilterBundle\Event;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;

/**
Expand Down
6 changes: 3 additions & 3 deletions Filter/FilterBuilderUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function addFilterConditions(FormInterface $form, $queryBuilder, $alias =
{
// create the right QueryInterface object
$event = new PrepareEvent($queryBuilder);
$this->dispatcher->dispatch(FilterEvents::PREPARE, $event);
$this->dispatcher->dispatch($event, FilterEvents::PREPARE);

if (!$event->getFilterQuery() instanceof QueryInterface) {
throw new \RuntimeException("Couldn't find any filter query object.");
Expand All @@ -103,7 +103,7 @@ public function addFilterConditions(FormInterface $form, $queryBuilder, $alias =

// walk condition nodes to add condition on the query builder instance
$name = sprintf('lexik_filter.apply_filters.%s', $event->getFilterQuery()->getEventPartName());
$this->dispatcher->dispatch($name, new ApplyFilterConditionEvent($queryBuilder, $this->conditionBuilder));
$this->dispatcher->dispatch(new ApplyFilterConditionEvent($queryBuilder, $this->conditionBuilder), $name);

$this->conditionBuilder = null;

Expand Down Expand Up @@ -207,7 +207,7 @@ protected function getFilterCondition(FormInterface $form, AbstractType $formTyp
}

$event = new GetFilterConditionEvent($filterQuery, $field, $values);
$this->dispatcher->dispatch($eventName, $event);
$this->dispatcher->dispatch($event, $eventName);

$condition = $event->getCondition();
}
Expand Down