Ferreteria/v0.6/clade/Sys/Events/has/ItWent

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Events
Jump to navigation Jump to search
clade: Sys\Events\has\ItWent
Clade Family
(root) ItWent [i,t] InputRq
Clade Aliases
Alias Clade
Status* [c,i] ItWent

Purpose

The tItWent trait automatically creates & caches an ItWent (action-status) object, whose class can be overridden.

The object is always available from the HowItWent() function.

Code

as of 2025-10-01

interface iItWent {
    function HowItWent() : StatusIface;
}
trait tItWent {
    // ++ CONFIG ++ //

    // DEFAULT
    protected function StatusClass() : string { return StatusClass::class; }

    // -- CONFIG -- //
    // ++ RESULT ++ //

    private $oStat = NULL;
    public function HowItWent() : StatusIface { return $this->oStat ?? ($this->oStat = new ($this->StatusClass())); }

    // -- RESULT -- //
}