Work on registration of existing systems to users
This commit is contained in:
@@ -8,7 +8,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
/**
|
||||
* Class Setup
|
||||
* This class represents our configuration.
|
||||
*
|
||||
* Our 'System' is defined by system_id, and from it we can find out our BBS name and addresses.
|
||||
*
|
||||
* @package App\Models
|
||||
* @property Collection nodes
|
||||
@@ -47,37 +49,6 @@ class Setup extends Model
|
||||
// Our non model attributes and values
|
||||
private array $internal = [];
|
||||
|
||||
public static function product_id(int $c=self::PRODUCT_ID): string
|
||||
{
|
||||
return hexstr($c);
|
||||
}
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function system()
|
||||
{
|
||||
return $this->belongsTo(System::class);
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
public function getLocationAttribute()
|
||||
{
|
||||
return $this->system->location;
|
||||
}
|
||||
|
||||
public function getSysopAttribute()
|
||||
{
|
||||
return $this->system->sysop;
|
||||
}
|
||||
|
||||
public function getSystemNameAttribute()
|
||||
{
|
||||
return $this->system->name;
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
@@ -143,6 +114,49 @@ class Setup extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Mailer Product ID in hex.
|
||||
*
|
||||
* @param int $c
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function product_id(int $c=self::PRODUCT_ID): string
|
||||
{
|
||||
return hexstr($c);
|
||||
}
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
/**
|
||||
* The defined system that this setup is valid for
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function system()
|
||||
{
|
||||
return $this->belongsTo(System::class);
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
public function getLocationAttribute()
|
||||
{
|
||||
return $this->system->location;
|
||||
}
|
||||
|
||||
public function getSysopAttribute()
|
||||
{
|
||||
return $this->system->sysop;
|
||||
}
|
||||
|
||||
public function getSystemNameAttribute()
|
||||
{
|
||||
return $this->system->name;
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
/* BINKP OPTIONS: BINKP_OPT_* */
|
||||
|
||||
public function binkpOptionClear(int $key): void
|
||||
|
Reference in New Issue
Block a user