mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Added logic to resolve crawlable short codes
This commit is contained in:
@@ -4,10 +4,23 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Crawling;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
||||
use Shlinkio\Shlink\Core\Repository\ShortUrlRepositoryInterface;
|
||||
|
||||
class CrawlingHelper implements CrawlingHelperInterface
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function listCrawlableShortCodes(): iterable
|
||||
{
|
||||
return [];
|
||||
/** @var ShortUrlRepositoryInterface $repo */
|
||||
$repo = $this->em->getRepository(ShortUrl::class);
|
||||
yield from $repo->findCrawlableShortCodes();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user