Ferreteria/v0.6/clade/Sys/Events/InputRq/@code/2026/04/26

From WoozleCodes
Jump to navigation Jump to search
code removed on 2026-04-26
replaced with $OPiece and ProcessPiece()
2026/04/25 2026/04/26 2026/04/27

old docs: Ferreteria/v0.6/clade/Sys/Events/InputRq/@fx/WithItemPiece

#
    protected function WithItemPiece(ItemIface $oItem, PieceIface $oPiece) : void {
        #$this->AmHere('ITEM NAME=['.$oItem->RenderUIName().']');
        $this->Item($oItem);
        $sVal = NULL;
        if ($oPiece->HasIt()) {
            $sVal = $oPiece->Value();
            $this->ParseInputArgs($oPiece->GetExtras());
            #$this->AmHere("SVAL=[$sVal]");
        } else {
            // check for default (used if request is present but with no value):
            $osDef = $oItem->QSDefault(); // TODO: Implement as $this->Attrs()->QryIt('valdef');
            if ($osDef->HasIt()) {
                $sVal = $osDef->GetIt();
            }
        }
        // Only change the state if there's actually a value:
        if (is_string($sVal)) {
            $this->ParseInputString($sVal);
        }
        $this->SaveInputState();
    }