Ferreteria/v0.6/clade/Sys/Data/Xfer/Info/Card/Fielded/@code/2025/05/18
Jump to navigation
Jump to search
| 2025/05/17 | 2025/05/18 | 2025/05/19 |
#
// ++ ACCESS: plural ++ //
// ASSUMES: we're using a *backed* enum (and all the helper-classes are also)
protected function ImportArray(array $arAlien) {
#echo $this->Deck()->Fields()->ReflectThis()->Report();
#$oFields = $this->ColDefs();
$oFields = $this->Deck()->Fields();
#echo $oFields->ReflectThis()->Report();
$this->Trader()->
$arImp = $oFields->Import($arAlien,$oMap);
foreach ($arAlien as $sAlien => $v) {
$oField = $oFields->GetByImpKey($sAlien); // get the proper field to map the import
if (is_object($oField)) {
$sName = $oField->DataName(); // local name
#echo self::GotToHere("Alien field [$sAlien]->[$sName] value=[$v]");
#echo $this->ReflectObject()->Report();
#$osField = $this->QField($sName);
#echo self::GotToHere();
$this->OAData()->SetIt($sName,$v);
#echo self::GotToHere();
} else {
// There was a config problem (shouldn't happen in production) -- display information about it:
$oScrn = self::Screen();
self::GotToHere();
$ftThis = $oScrn->InfoIt(get_called_class());
$scFields = get_class($oFields);
echo $this->ReflectObject()->Report();
#$scBridge = get_class($this->Bridge());
$ftFields = $oScrn->InfoIt($scFields);
$ftAlien = $oScrn->BoldIt($sAlien);
$oList = $oScrn->NewList();
echo "External field [$ftAlien] has not been configured.";
$oList->AddLine("Fields class: $ftFields");
$oList->AddLine("CardInfo class: $ftThis");
#$oList->AddItem("Bridge class: $scBridge")
echo $oList->Render();
echo $this->DumpFields();
echo 'Import contents:'.CRLF;
$oaImp = ArrayClass::FromArray($arAlien);
echo $oaImp->Dumper()->Render();
$this->HandleMissingField($sAlien); // TODO: need HandleMissingAlien() OSLT
}
}
}
// -- ACCESS -- //