vendor/shopware/core/Content/Product/SalesChannel/ProductAvailableFilter.php line 12

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Product\SalesChannel;
  3. use Shopware\Core\Content\Product\Aggregate\ProductVisibility\ProductVisibilityDefinition;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
  5. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\MultiFilter;
  6. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\RangeFilter;
  7. use Shopware\Core\Framework\Log\Package;
  8. #[Package('inventory')]
  9. class ProductAvailableFilter extends MultiFilter
  10. {
  11.     public function __construct(string $salesChannelIdint $visibility ProductVisibilityDefinition::VISIBILITY_ALL)
  12.     {
  13.         parent::__construct(
  14.             self::CONNECTION_AND,
  15.             [
  16.                 new RangeFilter('product.visibilities.visibility', [RangeFilter::GTE => $visibility]),
  17.                 new EqualsFilter('product.visibilities.salesChannelId'$salesChannelId),
  18.                 new EqualsFilter('product.active'true),
  19.             ]
  20.         );
  21.     }
  22. }