Changeset View
Changeset View
Standalone View
Standalone View
src/app/Handlers/Domain.php
<?php | <?php | ||||
namespace App\Handlers; | namespace App\Handlers; | ||||
use App\Sku; | use App\Sku; | ||||
class Domain | class Domain extends \App\Handlers\Base | ||||
machniak: This is the same namespace, so just "Base" here. | |||||
Done Inline ActionsI dislike these "incomplete" references tbh. They're sometimes necessary to maintain legibility of non-rendered documentation (i.e. inline while editing), if the absolute path is very long. However, should in no way be considered a show-stopper. The point is that observers rely on functions existing, and therefore we need to extend an abstract class by convention. vanmeeuwen: I dislike these "incomplete" references tbh.
They're sometimes necessary to maintain… | |||||
{ | { | ||||
public static function entitleableClass() | public static function entitleableClass() | ||||
{ | { | ||||
return \App\Domain::class; | return \App\Domain::class; | ||||
} | } | ||||
public static function preReq($entitlement, $domain) | public static function preReq($entitlement, $domain) | ||||
{ | { | ||||
if (!Sku::find($entitlement->sku_id)->active) { | if (!$entitlement->sku->active) { | ||||
\Log::error("Sku not active"); | \Log::error("Sku not active"); | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
} | } |
This is the same namespace, so just "Base" here.