src/Component/Vendor/Repository/TaxonRepository.php line 19

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file has been created by developers from BitBag.
  4.  * Feel free to contact us once you face any issues or want to start
  5.  * You can find more information about us on https://bitbag.io and write us
  6.  * an email on [email protected].
  7.  */
  8. declare(strict_types=1);
  9. namespace BitBag\OpenMarketplace\Component\Vendor\Repository;
  10. use Sylius\Bundle\TaxonomyBundle\Doctrine\ORM\TaxonRepository as BaseTaxonRepository;
  11. use Sylius\Component\Taxonomy\Model\TaxonInterface;
  12. final class TaxonRepository extends BaseTaxonRepository implements TaxonRepositoryInterface
  13. {
  14.     public function findForVendorPage(?string $slugstring $locale): ?TaxonInterface
  15.     {
  16.         if (null === $slug) {
  17.             $qb $this->createListQueryBuilder()
  18.                 ->andWhere('o.parent IS NULL')
  19.                 ->getQuery()
  20.                 ->getOneOrNullResult()
  21.             ;
  22.             return $qb;
  23.         }
  24.         return $this->findOneBySlug($slug$locale);
  25.     }
  26. }