Ferreteria/v0.6/clade/Sys/Events/InputRq/aux/InRqData/@retired: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Events‎ | InputRq‎ | aux/InRqData
Jump to navigation Jump to search
(Created page with "{{fmt/title|code removed from InRqData}} =={{fmt/date|2025|03|05}}== Cluttering up my hallway... {{fmt/php/block|1= // iface // SETUP static function FromOArray(ArrayIface $oa) : self; // ACCESS function OAData() : ArrayIface; // class // ++ SETUP ++ // static public function FromOArray(ArrayIface $oa) : iInRqData { $oThis = new static; $oThis->WithOArray($oa); return $oThis; } // ++ SETUP: dynamic ++...")
 
No edit summary
 
Line 1: Line 1:
{{fmt/title|code removed from [[../|InRqData]]}}
{{fmt/title|code removed from [[../|InRqData]]}}
=={{fmt/date|2025|10|09}}==
Commented out awhile ago:
{{fmt/php/block|1=
    // ++ CONFIG ++ //
    protected function QVarClass(int{{!}}string $snKey) : string { return QArrClass::class; }
    protected function QFieldClass(int{{!}}string $snKey) : string { return QArrClass::class; }
    static protected function ClassSlug() : string { return 'in.rq.data'; }
    static protected function ManifestClass() : string { return cInRqDatMfs::class; }
    // -- CONFIG -- //
    // ++ SETUP ++ //
    // trying to see how this is created -- but it's not here
    static public function FromStore(array $ar) : ArrayIface {
        self::GotToHere('FromStore');
        return parent::FromStore($ar);
    }
    public static function FromVArray(array $ar) : ArrayIface {
        self::GotToHere('FromVArray');
        return parent::FromVArray($ar);
    }
}}
=={{fmt/date|2025|03|05}}==
=={{fmt/date|2025|03|05}}==



Latest revision as of 21:44, 9 October 2025

code removed from InRqData

2025-10-09

Commented out awhile ago:

// ++ CONFIG ++ //

    protected function QVarClass(int|string $snKey) : string { return QArrClass::class; }
    protected function QFieldClass(int|string $snKey) : string { return QArrClass::class; }
    static protected function ClassSlug() : string { return 'in.rq.data'; }
    static protected function ManifestClass() : string { return cInRqDatMfs::class; }

    // -- CONFIG -- //
    // ++ SETUP ++ //

    // trying to see how this is created -- but it's not here
    static public function FromStore(array $ar) : ArrayIface {
        self::GotToHere('FromStore');
        return parent::FromStore($ar);
    }
    public static function FromVArray(array $ar) : ArrayIface {
        self::GotToHere('FromVArray');
        return parent::FromVArray($ar);
    }

2025-03-05

Cluttering up my hallway...

// iface

    // SETUP
    static function FromOArray(ArrayIface $oa) : self;
    // ACCESS
    function OAData() : ArrayIface;

// class

    // ++ SETUP ++ //

    static public function FromOArray(ArrayIface $oa) : iInRqData {
        $oThis = new static;
        $oThis->WithOArray($oa);
        return $oThis;
    }

    // ++ SETUP: dynamic ++ //

    private $oaData;
    protected function WithOArray(ArrayIface $oa) { $this->oaData = $oa; }

    // -- SETUP -- //
    // ++ ACCESS ++ //

    public function OAData() : ArrayIface { return $this->oaData; }

    // -- ACCESS -- //

2025-02-15

Significant reworking. We'll be decoding the input-string instead of keeping it, so QRaw() is no longer needed. Class now descends from array, so ValueArray() is redundant. UseContent() might be equivalent to still-needed functionality, but probably not under that name -- and it currently uses QRaw() (which is being removed). IsContentOk() might also still be useful, but not sure if needed (removing for now).

// interface
    function QRaw() : QStrIface;
// class
    // DEFAULT
    protected function UseContent(string $s) : void { $this->QRaw()->SetIt($s); }
    protected function IsContentOk(string $s) : bool { return TRUE; }  // STUB/DEFAULT

    // -- SETUP -- //
    // ++ ACCESS ++ //

    private $osVal = NULL;
    public function QRaw() : QStrIface { return $this->osVal ?? ($this->osVal = (QStrClass::FromNone())); }

    // -- ACCESS -- //
    // ++ INPUT ++ //

    private $arVals=NULL;
    protected function ValueArray() : array {
        if (is_null($this->arVals)) {
            $osVal = $this->QRaw();
            if ($osVal->HasIt()) {
                $sDataSpec = $osVal->GetIt();
                $ar = explode('/',$sDataSpec);
                $this->arVals = $ar;
            }
        }
        return $this->arVals;
    }

    // -- INPUT -- //

2025-02-14

Tentatively-ish, this stuff belongs in the request class, not the data class:

// ++ SETUP: dynamic: pieces ++ //

    protected function HandleString(string $s) : void {
        $s = $this->InRq()->Input();
        if ($s === '') {
            $this->HandleEmpty();
        } else {
            $this->HandleContent($s);
        }
    }
    /**
    * PURPOSE: when there is no value found during the argument-checking process,
    *  this method lets the user know if that's a problem.
    * TODO: more specific help for when it is a problem
    *   2025-02-14 Actually, shouldn't this be handled by the InRq?
    */
    protected function HandleEmpty() : void {
        $oScrn = self::Screen();
        echo '4';
        $oItem = $this->InRq()->Item();
        echo '5';
        $isValReq = $oItem->ValueIsRequired();
        echo '6';
        if ($isValReq) {
            echo '7';
            #echo $this->InRq()->ReflectThis()->Report(); die();
            $this->HandleMissing();
        }
    }
    protected function HandleContent(string $s) : void {
        if ($this->IsContentOk($s)) {
            $this->UseContent($s);
        }
    }
    /**
    * PURPOSE: handles when no setting-content is given (where the UI definition says one is required)
    * INSTAR: punts to the Input Request object to handle the situation
    */
    protected function HandleMissing() : void { $this->InRq()->HandleMissing(); }