Ferreteria/v0.6/clade/Sys/Data/aux/has/Schema: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{page/clade}} {| style="border: 1px solid black; float: right;" ! colspan=3 | Clade Family |- | align=right | ''(root)'' | → {{l/ver/clade|Sys\Data\aux\has|Schema}} | → {{l/ver/clade|Sys\Data\reqs\Engine|AdminRq}} |}") |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
| align=right | ''(root)'' | | align=right | ''(root)'' | ||
| → {{l/ver/clade|Sys\Data\aux\has|Schema}} | | → {{l/ver/clade|Sys\Data\aux\has|Schema}} | ||
| → {{l/ver/clade|Sys\Data\ | | → {{l/ver/clade|Sys\Data\Engine\aux\ActionRq|Admin}} | ||
|} | |} | ||
==Code== | |||
''as of 2025-10-04'' | |||
{{fmt/php/block|1= | |||
interface iSchema { | |||
// SETTINGS | |||
function QSSchema() : QStrIface; | |||
function QOSchema() : QObjIface; | |||
} | |||
// REQUIRES: tDbConn | |||
trait tSchema { | |||
protected function NewSchema() : SchemaIface { | |||
self::PromptForMethod(); // 2025-02-02 to be written, I presume | |||
} | |||
// schema name | |||
private $osSchm=NULL; | |||
public function QSSchema() : QStrIface { return $this->osSchm ?? ($this->osSchm = QStrClass::AsNew()); } | |||
// schema object | |||
protected $ooSchm=NULL; | |||
public function QOSchema() : QObjIface { | |||
$oo = $this->ooSchm; | |||
if (is_object($oo)) { | |||
$doTry = !$oo->HasIt(); | |||
} else { | |||
$oo = QObjClass::AsNew(); | |||
$doTry = TRUE; | |||
$this->ooSchm = $oo; | |||
} | |||
if ($doTry) { | |||
$os = $this->QSSchema(); // Schema name | |||
if ($os->HasIt()) { | |||
$sSch = $os->GetIt(); | |||
$oConn = $this->ODbConn(); // creates new DB object if needed | |||
$oSch = $oConn->GetSchema($sSch); | |||
$oo->SetIt($oSch); | |||
} | |||
} | |||
return $oo; | |||
} | |||
} | |||
}} | |||
Latest revision as of 02:07, 5 October 2025
| Clade Family | ||
|---|---|---|
| (root) | → Schema | → Admin |
Code
as of 2025-10-04
interface iSchema {
// SETTINGS
function QSSchema() : QStrIface;
function QOSchema() : QObjIface;
}
// REQUIRES: tDbConn
trait tSchema {
protected function NewSchema() : SchemaIface {
self::PromptForMethod(); // 2025-02-02 to be written, I presume
}
// schema name
private $osSchm=NULL;
public function QSSchema() : QStrIface { return $this->osSchm ?? ($this->osSchm = QStrClass::AsNew()); }
// schema object
protected $ooSchm=NULL;
public function QOSchema() : QObjIface {
$oo = $this->ooSchm;
if (is_object($oo)) {
$doTry = !$oo->HasIt();
} else {
$oo = QObjClass::AsNew();
$doTry = TRUE;
$this->ooSchm = $oo;
}
if ($doTry) {
$os = $this->QSSchema(); // Schema name
if ($os->HasIt()) {
$sSch = $os->GetIt();
$oConn = $this->ODbConn(); // creates new DB object if needed
$oSch = $oConn->GetSchema($sSch);
$oo->SetIt($oSch);
}
}
return $oo;
}
}