Ferreteria/v0.6/clade/Sys/Data/Engine/Conn/view/VConns

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | Conn‎ | view
Jump to navigation Jump to search
clade: Sys\Data\Engine\Conn\view\VConns
Clade Family
List VConns (none yet)
Clade Aliases
Alias Clade
Base* [c,i] Sys\Data\Things\Array\View\List
CnnxIface IO\Aspect\Connx
CredIface IO\Aspect\Creds
SockIface IO\Aspect\Socket
SubjIface Aux\StandardBase
TableIface IO\O\Data\Element\Branch\grid\Table
Subpages

About

  • Purpose: seems to be a viewer for a list of Connections.
  • See also: VConnx for singular viewer

Status

  • 2025-08-18 Not sure if this still works.

History

  • 2025-06-04 This may not be using the right structural assumptions anymore.
  • 2025-11-29 Commented out because I wanted to see if anything else was still using it.
  • 2025-12-03 Apparently [WFe]Sys\Data\Engine\Conn is still using it. Re-enabling (expect there will be broken bits).
    • Moved from [WFe]Sys\Data\aux\Viewer ⇒ [WFe]Sys\Data\Engine\Conn\view\VConn
  • 2025-12-04 Renamed from VConnVConns, to reflect the fact that it's a list.

Code

as of 2025-12-04:

interface iVConns extends BaseIface {}
class cVConns extends BaseClass implements iVConns {

    // ++ SETUP ++ //

    public function __construct(SubjIface $oSubj, private SockIface $oSock, private CredIface $oCred, private CnnxIface $oConn) {
        parent::__construct($oSubj);
    }
    protected function OSock() : SockIface { return $this->oSock; }
    protected function OCred() : CredIface { return $this->oCred; }
    protected function OConn() : CnnxIface { return $this->oConn; }

    // -- SETUP -- //
    // ++ OUTPUT ++ //

    // CEMENT
    public function Render() : string {

        $oa = $this->OArray();
        $n = $oa->Count();
        if ($n === 0) {
            $sOut = '{no db connections available}'.CRLF;
        } else {
            $sOut = $this->RenderPopulated();
        }
        return $sOut;
    }
    // OVERRIDE
    protected function AddTableHeader(TableIface $oTbl) : void {
        $oRow = $oTbl->NewRow();
        $oRow->IsHeader(TRUE);
        $oRow->WithData(['connection name','details']);  // header
    }
    // OVERRIDE
    protected function RenderObject(object $oSubj) : string { return $oSubj->DescribeInline(); }

    // -- OUTPUT -- //
}