Changeset View
Changeset View
Standalone View
Standalone View
src/app/Transaction.php
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | class Transaction extends Model | ||||
private function getEntitlementObjectEmail(): ?string | private function getEntitlementObjectEmail(): ?string | ||||
{ | { | ||||
$entitlement = $this->entitlement(); | $entitlement = $this->entitlement(); | ||||
if (!$entitlement) { | if (!$entitlement) { | ||||
return null; | return null; | ||||
} | } | ||||
$entitleable = $entitlement->entitleable; | $user = \App\User::withTrashed()->where('id', $entitlement->object_id)->first(); | ||||
if (!$entitleable) { | if (!$user) { | ||||
\Log::debug("No entitleable for {$entitlement->id} ?"); | \Log::debug("No entitleable for {$entitlement->id} ?"); | ||||
return null; | return null; | ||||
} | } | ||||
return $entitleable->email; | return $user->email; | ||||
} | } | ||||
/** | /** | ||||
* Return the title for the SKU this entitlement is for. | * Return the title for the SKU this entitlement is for. | ||||
* | * | ||||
* @return string|null | * @return string|null | ||||
*/ | */ | ||||
private function getEntitlementSkuTitle(): ?string | private function getEntitlementSkuTitle(): ?string | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |