vendor/shopware/core/Framework/DataAbstractionLayer/Search/AggregationResult/Metric/EntityResult.php line 12

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric;
  3. use Shopware\Core\Framework\DataAbstractionLayer\Entity;
  4. use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
  5. use Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\AggregationResult;
  6. use Shopware\Core\Framework\Log\Package;
  7. /**
  8.  * @final
  9.  *
  10.  * @template TEntityCollection of EntityCollection
  11.  */
  12. #[Package('core')]
  13. class EntityResult extends AggregationResult
  14. {
  15.     /**
  16.      * @param TEntityCollection $entities
  17.      */
  18.     public function __construct(string $name, protected EntityCollection $entities)
  19.     {
  20.         parent::__construct($name);
  21.     }
  22.     /**
  23.      * @return TEntityCollection
  24.      */
  25.     public function getEntities(): EntityCollection
  26.     {
  27.         return $this->entities;
  28.     }
  29.     public function add(Entity $entity): void
  30.     {
  31.         $this->entities->add($entity);
  32.     }
  33. }