Ferreteria/v0.6/clade/Sys/FileSys/Aspect

From WoozleCodes
Jump to navigation Jump to search
clade: Sys\FileSys\Aspect
Clade Family
StandardBase Aspect

Ident
InOut

Clade Aliases
Alias Clade
Base* [c,i] Aux\StandardBase
Node* [c,i] Sys\FileSys\Node
Subpages

History

  • 2025-11-15 Node() needs to be public so other classes can get access to the whole structure from any Aspect.
  • 2025-12-15 SelfNodeClass(): When do we use this?
  • 2026-05-03 SelfNodeClass() was so that we can recreate the parent-Node from just an Aspect.
  • The abstract declaration was commented out on 2025-12-15.
  • It was only being used in TargetNode(), which itself does not seem to be used.
  • I'm commenting out TargetNode() and all implementations of SelfNodeClass() in this clade-family.

Code

as of 2025-11-05

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 -- //
}