mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-20 13:04:02 +00:00
31 lines
670 B
PHP
31 lines
670 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Bookings\Services;
|
|
|
|
|
|
class GeneratesBookingMarking
|
|
{
|
|
|
|
/** @var ChecksIfBookingMarkingExists */
|
|
private $bookingMarkingExists;
|
|
|
|
/**
|
|
* GeneratesWalletCode constructor.
|
|
* @param ChecksIfBookingMarkingExists $bookingMarkingExists
|
|
*/
|
|
public function __construct(ChecksIfBookingMarkingExists $bookingMarkingExists)
|
|
{
|
|
$this->bookingMarkingExists = $bookingMarkingExists;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function execute(): int {
|
|
|
|
$marking = mt_rand(100000, 999999);
|
|
return !$this->bookingMarkingExists->execute($marking) ? $marking : self::execute();
|
|
}
|
|
|
|
} |