Skip to content

Instantly share code, notes, and snippets.

@Koc
Last active May 28, 2019 09:04
Show Gist options
  • Save Koc/2083ce1b749e3c4c9c2b399d0f14c234 to your computer and use it in GitHub Desktop.
Save Koc/2083ce1b749e3c4c9c2b399d0f14c234 to your computer and use it in GitHub Desktop.
Specificator Aggregations
<?php
namespace Brouzie\Specificator;
interface FiltersResettableAggregation
{
/**
* Returns true for filters that prevent building this aggregation, false otherwise.
*/
public function isFilterShouldBeExcluded(object $filter): bool;
}
<?php
namespace App\Product\Application\Query\Aggregation;
use App\Application\Query\Product\Filter\PriceRangeFilter;
use Brouzie\Specificator\FiltersResettingAggregation;
class PriceRangeAggregation implements FiltersResettingAggregation
{
public function isFilterShouldBeExcluded(object $filter): bool
{
return $filter instanceof PriceRangeFilter;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment