領収証発行サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
648B

  1. <?php
  2. namespace App\Logic\ReceiptIssuingOrder;
  3. use App\Models\ReceiptIssuingOrder;
  4. use App\Util\DateUtil;
  5. class TokenCheckManager extends ReceiptIssuingOrderManager
  6. {
  7. public function __construct(
  8. protected ReceiptIssuingOrder $order,
  9. ) {
  10. parent::__construct($order);
  11. }
  12. public function check(string $token): bool
  13. {
  14. $ret = $this->checkToken($token);
  15. if (
  16. $ret &&
  17. $this->order->status_first_access_datetime === null
  18. ) {
  19. $this->order->status_first_access_datetime = DateUtil::now();
  20. $this->save();
  21. }
  22. return $ret;
  23. }
  24. }