mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-05 23:03:11 +08:00
30 lines
718 B
PHP
30 lines
718 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Core\Domain;
|
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Shlinkio\Shlink\Core\Domain\Repository\DomainRepositoryInterface;
|
|
use Shlinkio\Shlink\Core\Entity\Domain;
|
|
|
|
class DomainService implements DomainServiceInterface
|
|
{
|
|
private EntityManagerInterface $em;
|
|
|
|
public function __construct(EntityManagerInterface $em)
|
|
{
|
|
$this->em = $em;
|
|
}
|
|
|
|
/**
|
|
* @return Domain[]
|
|
*/
|
|
public function listDomainsWithout(?string $excludeDomain = null): array
|
|
{
|
|
/** @var DomainRepositoryInterface $repo */
|
|
$repo = $this->em->getRepository(Domain::class);
|
|
return $repo->findDomainsWithout($excludeDomain);
|
|
}
|
|
}
|