Ferreteria/v0.6/clade/Sys/Data/Engine/aux/ActionRq/Admin/dbase/EngDbExport: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{page/clade/v2 |fam= {{!}} align=right {{!}} {{l/ver/clade|Sys\Data\Engine\aux\ActionRq\Admin|ToDbOper}} {{!}} align=center {{!}} → {{l/ver/clade|Sys\Data\Engine\aux\ActionRq\Admin\ToDbOper|EngDbExport}} → {{!}} align=left {{!}} ''(none)'' |alia= {{!}}- {{!}} '''Base'''* [ca,i] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Data\Engine\aux\ActionRq\Admin|ToDbOper}} {{!}}- {{!}} '''File'''* [c] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\FileSys\Node|Fi}} {{!}}-...") |
No edit summary |
||
| Line 14: | Line 14: | ||
}} | }} | ||
==Pages== | |||
* [[2025/10/08]]: fixing the call to <code>FromParams()</code> | |||
==Code== | ==Code== | ||
''as of 2025-10-07'' | ''as of 2025-10-07'' | ||
Revision as of 13:40, 8 October 2025
| ||||||||||||||||||
Pages
- 2025/10/08: fixing the call to
FromParams()
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 ++ //
}