Changeset View
Changeset View
Standalone View
Standalone View
src/app/Handlers/Beta/Base.php
<?php | <?php | ||||
namespace App\Handlers\Beta; | namespace App\Handlers\Beta; | ||||
class Base extends \App\Handlers\Base | class Base extends \App\Handlers\Base | ||||
{ | { | ||||
/** | /** | ||||
* The entitleable class for this handler. | |||||
* | |||||
* @return string | |||||
*/ | |||||
public static function entitleableClass(): string | |||||
{ | |||||
return \App\User::class; | |||||
} | |||||
/** | |||||
* Check if the SKU is available to the user/domain. | * Check if the SKU is available to the user/domain. | ||||
* | * | ||||
* @param \App\Sku $sku The SKU object | * @param \App\Sku $sku The SKU object | ||||
* @param \App\User|\App\Domain $object The user or domain object | * @param \App\User|\App\Domain $object The user or domain object | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public static function isAvailable(\App\Sku $sku, $object): bool | public static function isAvailable(\App\Sku $sku, $object): bool | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public static function preReq($entitlement, $object): bool | ||||
if (!parent::preReq($entitlement, $object)) { | if (!parent::preReq($entitlement, $object)) { | ||||
return false; | return false; | ||||
} | } | ||||
// TODO: User has to have the "beta" entitlement | // TODO: User has to have the "beta" entitlement | ||||
return true; | return true; | ||||
} | } | ||||
/** | |||||
* The priority that specifies the order of SKUs in UI. | |||||
* Higher number means higher on the list. | |||||
* | |||||
* @return int | |||||
*/ | |||||
public static function priority(): int | |||||
{ | |||||
return 10; | |||||
} | |||||
} | } |