update email template
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Integrations\Whmcs\Support;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/** Resolves a WHMCS `tblhosting.id` to the local `order_items.id` via `legacy_id` (1:1, same source row). */
|
||||
class OrderItemIdResolver
|
||||
{
|
||||
/** @var array<int, int>|null */
|
||||
private static ?array $map = null;
|
||||
|
||||
public function resolve(int $legacyHostingId): ?int
|
||||
{
|
||||
self::$map ??= DB::table('order_items')->whereNotNull('legacy_id')->pluck('id', 'legacy_id')->all();
|
||||
|
||||
return self::$map[$legacyHostingId] ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user