Ferreteria/v0.6/clade/Sys/Data/Engine/aux/ActionRq/Admin/dbase/EngDbExport
Jump to navigation
Jump to search
| ||||||||||||||||||
Code
as of 2025-10-07
interface iEngDbExport extends BaseIface {}
abstract class caEngDbExport extends BaseClass implements iEngDbExport {
// ++ CONFIG ++ //
abstract protected function EngScExportRequestClass() : string;
// -- CONFIG -- //
// ++ ACTION ++ //
// CEMENT
public function Go() {
$oScrn = self::Screen();
$oDBC = $this->QDbOper()->GetIt();
$oTplt = $this->FileSpecTemplate();
$oTplt->Lookup()->QEngine()->SetIt($oDBC);
$oTplt = $this->FileSpecTemplate();
$oLook = $oTplt->Lookup(); // filename template
$arSch = $oDBC->SchemaList();
$nSch = count($arSch);
if ($nSch == 0) {
echo $oScrn->ErrorIt('Problem').': no schemas found.'.CRLF;
$ok = FALSE;
} else {
$ok = TRUE;
echo $nSch.' schema'.(($nSch==1)?'':'s').' found.'.CRLF;
foreach ($arSch as $oSchema) {
$oLook->QSchema()->SetIt($oSchema); // provide schema info for template ($oTplt)
$fsData = $oTplt->Render();
$ofData = FileClass::FromSpec($fsData);
#$oSchReq = $this->NewEngScExportRequest();
$sc = $this->EngScExportRequestClass();
echo $sc::ReflectSelf()->Report();
$oSchReq = $sc::FromParams($oSchema,$ofData);
$oSchReq->Go();
}
}
if ($ok) {
echo $oScrn->GreenIt('Ok!').' - Backup complete.'.CRLF;
} else {
echo $oScrn->YellowIt('Note').': - one or more issues were found during backup.'.CRLF;
}
}
// -- ACTION -- //
// ++ OBJECTS ++ //
protected function FileSpecTemplate() : TemplateIface { return FilePaths::Me()->ExportFiTplt(); }
// -- OBJECTS ++ //
}