This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
vbbs/app/Classes/Frame/Action.php
2018-12-11 23:31:44 +11:00

38 lines
797 B
PHP

<?php
namespace App\Classes\Frame;
use Illuminate\Support\Facades\Log;
use App\Classes\Server;
use App\User;
abstract class Action
{
const prefix = 'App\Classes\Frame\Action\\';
public $so = NULL;
public $uo = NULL;
public $action = NULL;
public $mode = NULL;
public $page = [];
public function __construct(Server $so,User $uo,int $action,int $mode)
{
$this->so = $so;
$this->uo = $uo;
$this->action = $action;
$this->mode = $mode;
}
public static function factory(string $class,Server $so,User $uo,int $action,int $mode)
{
$c = self::prefix.$class;
$o = class_exists($c) ? new $c($so,$uo,$action,$mode) : FALSE;
$so->log('debug',sprintf(($o ? 'Executing: %s' : 'Class doesnt exist: %s'),$c));
return $o;
}
abstract public function handle(array $fielddata);
}