Futilities/v0.6/clade/Sys/dba/InReq: Difference between revisions
< Futilities | v0.6 | clade | Sys | dba
Jump to navigation
Jump to search
m (fixed template usage) |
No edit summary |
||
| Line 44: | Line 44: | ||
** {{fmt/php/inline|$this->OAUserInput()}} returns the raw input value strings (split but not parsed), one element for each term in the user input | ** {{fmt/php/inline|$this->OAUserInput()}} returns the raw input value strings (split but not parsed), one element for each term in the user input | ||
==Code== | ==Code== | ||
''as of 2025-10- | ''as of 2025-10-25'' | ||
{{fmt/php/block|1= | {{fmt/php/block|1= | ||
interface iInReq extends BaseIface, DbStuffIface { | interface iInReq extends BaseIface, DbStuffIface { | ||
| Line 51: | Line 51: | ||
} | } | ||
trait tInReq { | trait tInReq { | ||
use DbStuffTrait; // 2025-10-11 needed for QOFData() | |||
use InDataTrait; // 2025-09-25 might create a conflict | use InDataTrait; // 2025-09-25 might create a conflict | ||
| Line 81: | Line 82: | ||
protected function SaveAsEngConnName(string $s) { | protected function SaveAsEngConnName(string $s) { | ||
$this->OAUserInput()-> | $this->OAUserInput()->QDbConnSlug()->SetIt($s); // 2025-10-08 Does this work? (Fix it, if not.) | ||
} | } | ||
Revision as of 00:03, 26 October 2025
| ||||||||||||||||||||||||||||||
Purpose
Each object encapsulates a given input (request) term. Podling-clades will implement actions and provide functions to access needed values from the input, which is encapsulated by a cInRqData object which can be retrieved from function OAUserInput().
To make use of additional user arguments (after the first), InputRq podlings (aka InReq podlings) can implement function ParseInputArgs(array $ar).
Doing Stuff
- To access input arguments, get an appropriate cInRqData object:
$this->OAUserInput()returns the raw input value strings (split but not parsed), one element for each term in the user input
Code
as of 2025-10-25
interface iInReq extends BaseIface, DbStuffIface {
// OUTPUT
function ListHosts() : string;
}
trait tInReq {
use DbStuffTrait; // 2025-10-11 needed for QOFData()
use InDataTrait; // 2025-09-25 might create a conflict
// ++ OBJECTS: requests ++ //
protected function QOSchemaMeta() : QObjIface {
// check to see if we *can* get a Schema object
$of = FilePaths::Me()->ImportFoNode();
$oStat = $of->IndexIt();
echo $oStat->RenderMessages(); // any messages, error or otherwise
if ($oStat->GetOkay()) {
$sScSlug = $this->QSSchema()->GetIt();
$osSchNode = $of->FindSchema($sScSlug); // TODO: possibly this should go in aux\has\tSchema
} else {
$osSchNode = QObjClass::AsNew();
}
return $osSchNode;
}
// -- OBJECTS -- //
// ++ INPUTS: processing ++ //
// CEMENT
protected function ParseInputArgs(array $ar) {
$nXArgs = count($ar);
if ($nXArgs > 0) {
$this->AmHere('TODO 2025-10-04: interpret optional additional arguments');
}
}
protected function SaveAsEngConnName(string $s) {
$this->OAUserInput()->QDbConnSlug()->SetIt($s); // 2025-10-08 Does this work? (Fix it, if not.)
}
// ++ INPUTS: parsed/stored ++ //
protected function QDbConnSlug() : QStrIface {
return $this->OAUserInput()->QDbConnSlug();
}
protected function QSchemaSlug() : QStrIface {
return $this->OAUserInput()->QSchemaSlug();
}
// -- INPUT -- //
}