DeleteOldAttempts.php 810 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Captcha\Cron;
  7. /**
  8. * Captcha cron actions
  9. */
  10. class DeleteOldAttempts
  11. {
  12. /**
  13. * @var \Magento\Captcha\Model\ResourceModel\LogFactory
  14. */
  15. protected $resLogFactory;
  16. /**
  17. * @param \Magento\Captcha\Model\ResourceModel\LogFactory $resLogFactory
  18. */
  19. public function __construct(
  20. \Magento\Captcha\Model\ResourceModel\LogFactory $resLogFactory
  21. ) {
  22. $this->resLogFactory = $resLogFactory;
  23. }
  24. /**
  25. * Delete Unnecessary logged attempts
  26. *
  27. * @return \Magento\Captcha\Cron\DeleteOldAttempts
  28. */
  29. public function execute()
  30. {
  31. $this->resLogFactory->create()->deleteOldAttempts();
  32. return $this;
  33. }
  34. }