mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
37 lines
952 B
PHP
37 lines
952 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\CLI\Command\Visit;
|
|
|
|
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
|
use Shlinkio\Shlink\Common\Util\DateRange;
|
|
use Shlinkio\Shlink\Core\Entity\Visit;
|
|
use Shlinkio\Shlink\Core\Model\VisitsParams;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
class GetOrphanVisitsCommand extends AbstractVisitsListCommand
|
|
{
|
|
public const NAME = 'visit:orphan';
|
|
|
|
protected function doConfigure(): void
|
|
{
|
|
$this
|
|
->setName(self::NAME)
|
|
->setDescription('Returns the list of orphan visits.');
|
|
}
|
|
|
|
protected function getVisitsPaginator(InputInterface $input, DateRange $dateRange): Paginator
|
|
{
|
|
return $this->visitsHelper->orphanVisits(new VisitsParams($dateRange));
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function mapExtraFields(Visit $visit): array
|
|
{
|
|
return ['type' => $visit->type()->value];
|
|
}
|
|
}
|