Ferreteria/v0.6/clade/Sys/FileSys/Aspect/@code/2025/11/05

From WoozleCodes
Jump to navigation Jump to search
2025/11/04 2025/11/05 2025/11/06


interface iAspect extends BaseIface {
    static function FromNode(NodeIface $o) : self;
}
abstract class caAspect extends BaseClass implements iAspect {
    // ++ CONFIG ++ //

    protected function NodeClass() : string { return NodeClass::class; }

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

    public static function FromNode(NodeIface $o) : iAspect {
        $oThis = new static;
        $oThis->Node($o);
        return $oThis;
    }

    // -- SETUP -- //
    // ++ STRUCT ++ //

    private $oNode = NULL;
    protected function Node(?NodeIface $o=NULL) : NodeIface { return is_object($o) ? ($this->oNode = $o) : ($this->oNode ?? ($this->oNode = $this->NewNode())); }
    abstract protected function NewNode() : NodeIface;

    // -- STRUCT -- //
}