Skip to content

Commit

Permalink
added a
Browse files Browse the repository at this point in the history
  • Loading branch information
einorler committed Sep 20, 2016
1 parent acc7aa1 commit 6411ce9
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Event/PreProcessSearchEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ONGR\FilterManagerBundle\Event;

use ONGR\ElasticsearchDSL\Search;
use ONGR\FilterManagerBundle\Filter\FilterInterface;
use Symfony\Component\EventDispatcher\Event;

class PreProcessSearchEvent extends Event
{
/**
* @var FilterInterface
*/
private $filter;

/**
* @var Search
*/
private $relatedSearch;

/**
* Constructor
*
* @param FilterInterface $filter
* @param Search $relatedSearch
*/
public function __construct(FilterInterface $filter, Search $relatedSearch)
{
$this->filter = $filter;
$this->relatedSearch = $relatedSearch;
}

/**
* @return FilterInterface
*/
public function getFilter()
{
return $this->filter;
}

/**
* @return Search
*/
public function getRelatedSearch()
{
return $this->relatedSearch;
}
}
6 changes: 6 additions & 0 deletions ONGRFilterManagerEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ final class ONGRFilterManagerEvents
* The SEARCH_RESPONSE event occurs after search is executed
*/
const SEARCH_RESPONSE = 'ongr_filter_manager.search_response';

/**
* The PRE_PROCESS_SEARCH event occurs before the preProcessSearch method of
* the filter is called
*/
const PRE_PROCESS_SEARCH = 'ongr_filter_manager.pre_process_search';
}

0 comments on commit 6411ce9

Please sign in to comment.