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

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\EntityRepositoryInterface;
  10. use Shopware\Core\System\SalesChannel\SalesChannelEntity;
  11. use Swag\PayPal\Pos\Run\Administration\LogCleaner;
  12. class CleanUpLogTaskHandler extends AbstractSyncTaskHandler
  13. {
  14.     private LogCleaner $logCleaner;
  15.     public function __construct(
  16.         EntityRepositoryInterface $scheduledTaskRepository,
  17.         EntityRepositoryInterface $salesChannelRepository,
  18.         LogCleaner $logCleaner
  19.     ) {
  20.         parent::__construct($scheduledTaskRepository$salesChannelRepository);
  21.         $this->logCleaner $logCleaner;
  22.     }
  23.     public static function getHandledMessages(): iterable
  24.     {
  25.         return [CleanUpLogTask::class];
  26.     }
  27.     protected function executeTask(SalesChannelEntity $salesChannelContext $context): void
  28.     {
  29.         $this->logCleaner->cleanUpLog($salesChannel->getId(), $context);
  30.     }
  31. }