Loading src/Event/FacetsEvents.php 0 → 100644 +19 −0 Original line number Diff line number Diff line <?php namespace Drupal\facets\Event; /** * Defines events for the Facets module. */ final class FacetsEvents { /** * This event allows modules to change the facet's query string if needed. * * @Event * * @see \Drupal\facets\Event\QueryStringCreated */ public const QUERY_STRING_CREATED = QueryStringCreated::class; } src/Event/QueryStringCreated.php +5 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ namespace Drupal\facets\Event; use Drupal\facets\FacetInterface; use Drupal\facets\Result\ResultInterface; use Symfony\Component\EventDispatcher\Event; use Drupal\Component\EventDispatcher\Event; use Symfony\Component\HttpFoundation\ParameterBag; /** Loading @@ -14,7 +14,10 @@ use Symfony\Component\HttpFoundation\ParameterBag; */ final class QueryStringCreated extends Event { const NAME = 'facets.query_string_created'; /** * @deprecated use FacetsEvents::QUERY_STRING_CREATED instead */ public const NAME = FacetsEvents::QUERY_STRING_CREATED; /** * The get parameters. Loading src/Plugin/facets/url_processor/QueryString.php +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ class QueryString extends UrlProcessorPluginBase { // Allow other modules to alter the result url built. $event = new QueryStringCreated($result_get_params, $filter_params, $result, $this->activeFilters, $facet); $this->eventDispatcher->dispatch(QueryStringCreated::NAME, $event); $this->eventDispatcher->dispatch($event); $filter_params = $event->getFilterParameters(); asort($filter_params, \SORT_NATURAL); Loading Loading
src/Event/FacetsEvents.php 0 → 100644 +19 −0 Original line number Diff line number Diff line <?php namespace Drupal\facets\Event; /** * Defines events for the Facets module. */ final class FacetsEvents { /** * This event allows modules to change the facet's query string if needed. * * @Event * * @see \Drupal\facets\Event\QueryStringCreated */ public const QUERY_STRING_CREATED = QueryStringCreated::class; }
src/Event/QueryStringCreated.php +5 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ namespace Drupal\facets\Event; use Drupal\facets\FacetInterface; use Drupal\facets\Result\ResultInterface; use Symfony\Component\EventDispatcher\Event; use Drupal\Component\EventDispatcher\Event; use Symfony\Component\HttpFoundation\ParameterBag; /** Loading @@ -14,7 +14,10 @@ use Symfony\Component\HttpFoundation\ParameterBag; */ final class QueryStringCreated extends Event { const NAME = 'facets.query_string_created'; /** * @deprecated use FacetsEvents::QUERY_STRING_CREATED instead */ public const NAME = FacetsEvents::QUERY_STRING_CREATED; /** * The get parameters. Loading
src/Plugin/facets/url_processor/QueryString.php +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ class QueryString extends UrlProcessorPluginBase { // Allow other modules to alter the result url built. $event = new QueryStringCreated($result_get_params, $filter_params, $result, $this->activeFilters, $facet); $this->eventDispatcher->dispatch(QueryStringCreated::NAME, $event); $this->eventDispatcher->dispatch($event); $filter_params = $event->getFilterParameters(); asort($filter_params, \SORT_NATURAL); Loading