vendor/shopware/core/Framework/DataAbstractionLayer/Search/Aggregation/Metric/StatsAggregation.php line 10

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\DataAbstractionLayer\Search\Aggregation\Metric;
  3. use Shopware\Core\Framework\DataAbstractionLayer\Search\Aggregation\Aggregation;
  4. use Shopware\Core\Framework\Log\Package;
  5. /**
  6.  * @final
  7.  */
  8. #[Package('core')]
  9. class StatsAggregation extends Aggregation
  10. {
  11.     public function __construct(
  12.         string $name,
  13.         string $field,
  14.         protected readonly bool $max true,
  15.         protected readonly bool $min true,
  16.         protected readonly bool $sum true,
  17.         protected readonly bool $avg true
  18.     ) {
  19.         parent::__construct($name$field);
  20.     }
  21.     public function fetchMax(): bool
  22.     {
  23.         return $this->max;
  24.     }
  25.     public function fetchMin(): bool
  26.     {
  27.         return $this->min;
  28.     }
  29.     public function fetchSum(): bool
  30.     {
  31.         return $this->sum;
  32.     }
  33.     public function fetchAvg(): bool
  34.     {
  35.         return $this->avg;
  36.     }
  37. }