vendor/shopware/core/Content/Seo/MainCategory/MainCategoryCollection.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Seo\MainCategory;
  3. use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
  4. /**
  5.  * @extends EntityCollection<MainCategoryEntity>
  6.  */
  7. class MainCategoryCollection extends EntityCollection
  8. {
  9.     public function filterBySalesChannelId(string $id): MainCategoryCollection
  10.     {
  11.         return $this->filter(static function (MainCategoryEntity $mainCategory) use ($id) {
  12.             return $mainCategory->getSalesChannelId() === $id;
  13.         });
  14.     }
  15.     public function getApiAlias(): string
  16.     {
  17.         return 'seo_main_category_collection';
  18.     }
  19.     protected function getExpectedClass(): string
  20.     {
  21.         return MainCategoryEntity::class;
  22.     }
  23. }