<?php
namespace Products\NotificationsBundle\Doctrine\Repository\Notifications;
use Cms\TenantBundle\Model\SimpleTenantableInterface;
use Products\NotificationsBundle\Doctrine\Repository\AbstractNotificationRepository;
use Products\NotificationsBundle\Entity\NotificationsConfig;
/**
* @method NotificationsConfig find($id, $lockMode = null, $lockVersion = null)
* @method NotificationsConfig findOneBy(array $criteria, array $orderBy = null)
* @method array|NotificationsConfig[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
* @method array|NotificationsConfig[] findAll()
*/
class NotificationsConfigRepository extends AbstractNotificationRepository
{
/**
* @param SimpleTenantableInterface $tenantable
* @return NotificationsConfig|null
*/
public function findForTenant(SimpleTenantableInterface $tenantable): ?NotificationsConfig
{
return $this->findOneBy([
'tenant' => $tenantable->getTenant(),
]);
}
}