interface iOper extends BaseIface {
// ACTION: requests
function DoDataRequest(DataReqIface $oReq);
// ACTION: parameterized
function SchemaList() : SchemasIface;
function DoUserSetup();
// OBJECTS
function GetSchema(string $sName) : SchemaIface;
#function Register() : RegIface; // SHORTCUT
// INFO
function ConnSlug() : string; // connection shortname
}
abstract class caOper extends BaseClass implements SelfIface {
// ++ CONFIG ++ //
abstract protected function CommOpClass() : string;
abstract protected function SchemaClass() : string;
abstract protected function ScribeClass() : string;
// -- CONFIG -- //
// ++ SETUP ++ //
protected function __construct() {}
// USAGE: Only call if constructing to pass to a Conn object's constructor
static public function ForConn() : iOper {
$oThis = new static;
return $oThis;
}
static public function FromConn(ConnIface $oConn) : iOper {
$oThis = new static;
$oThis->WithConn($oConn);
return $oThis;
}
// ++ SETUP: dynamic ++ //
private $oConn=NULL;
public function WithConn(ConnIface $oConn) : void {
$this->oConn = $oConn;
#$this->RegisterThis();
}
protected function OConn() : ConnIface { return $this->oConn; }
// -- SETUP -- //
// ++ OBJECTS ++ //
// TODO: Rename to OSchema()
public function GetSchema(string $sName) : SchemaIface { return new ($this->SchemaClass())($this->OConn(),$sName); }
// -- OBJECTS -- //
// ++ INFO ++ //
public function ConnSlug() : string { return $this->OConn()->ObjectSlug(); }
// -- INFO -- //
// ++ UI ++ //
// UNPROMPT
public function DescribeInline() : string { return $this->OConn()->DescribeInline(); } // sometimes not needed
// -- UI -- //
}
// 2025-06-06 default should take care of this now
protected function RegisterThis() {
$oConn = $this->OConn();
#echo $oConn->ReflectThis()->Report(); // how do we get the ObjectSlug()?
$sSlug = $oConn->Slug();
$this->Register()->SetIt($sSlug,$oConn);
}