src/Products/NotificationsBundle/Doctrine/Repository/Notifications/NotificationsConfigRepository.php line 21

Open in your IDE?
  1. <?php
  2. namespace Products\NotificationsBundle\Doctrine\Repository\Notifications;
  3. use Cms\TenantBundle\Model\SimpleTenantableInterface;
  4. use Products\NotificationsBundle\Doctrine\Repository\AbstractNotificationRepository;
  5. use Products\NotificationsBundle\Entity\NotificationsConfig;
  6. /**
  7.  * @method NotificationsConfig find($id, $lockMode = null, $lockVersion = null)
  8.  * @method NotificationsConfig findOneBy(array $criteria, array $orderBy = null)
  9.  * @method array|NotificationsConfig[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  10.  * @method array|NotificationsConfig[] findAll()
  11.  */
  12. class NotificationsConfigRepository extends AbstractNotificationRepository
  13. {
  14.     /**
  15.      * @param SimpleTenantableInterface $tenantable
  16.      * @return NotificationsConfig|null
  17.      */
  18.     public function findForTenant(SimpleTenantableInterface $tenantable): ?NotificationsConfig
  19.     {
  20.         return $this->findOneBy([
  21.             'tenant' => $tenantable->getTenant(),
  22.         ]);
  23.     }
  24. }