24 lines
584 B
PHP
24 lines
584 B
PHP
<?php
|
|
|
|
namespace App\Integrations\Whmcs\Extractors;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\LazyCollection;
|
|
|
|
class AddonExtractor
|
|
{
|
|
public function extract(): LazyCollection
|
|
{
|
|
return DB::connection('whmcs')->table('tbladdons')->orderBy('id')->cursor();
|
|
}
|
|
|
|
/** tblpricing row for this addon, if any (type='addon'). */
|
|
public function pricing(int $addonId): ?object
|
|
{
|
|
return DB::connection('whmcs')->table('tblpricing')
|
|
->where('type', 'addon')
|
|
->where('relid', $addonId)
|
|
->first();
|
|
}
|
|
}
|