custom/plugins/SwagPayPal/src/Pos/Schedule/CleanUpLogTaskHandler.php line 18

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /*
  3.  * (c) shopware AG <info@shopware.com>
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  */
  7. namespace Swag\PayPal\Pos\Schedule;
  8. use Shopware\Core\Framework\Context;
  9. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
  10. use Shopware\Core\System\SalesChannel\SalesChannelEntity;
  11. use Swag\PayPal\Pos\Run\Administration\LogCleaner;
  12. /**
  13.  * @internal
  14.  */
  15. class CleanUpLogTaskHandler extends AbstractSyncTaskHandler
  16. {
  17.     private LogCleaner $logCleaner;
  18.     public function __construct(
  19.         EntityRepository $scheduledTaskRepository,
  20.         EntityRepository $salesChannelRepository,
  21.         LogCleaner $logCleaner
  22.     ) {
  23.         parent::__construct($scheduledTaskRepository$salesChannelRepository);
  24.         $this->logCleaner $logCleaner;
  25.     }
  26.     public static function getHandledMessages(): iterable
  27.     {
  28.         return [CleanUpLogTask::class];
  29.     }
  30.     protected function executeTask(SalesChannelEntity $salesChannelContext $context): void
  31.     {
  32.         $this->logCleaner->cleanUpLog($salesChannel->getId(), $context);
  33.     }
  34. }