Ferreteria/v0.6/clade/Sys/Data/Engine/Conn/view/VConns
Jump to navigation
Jump to search
| ||||||||||||||||||||||||
About
- Purpose: seems to be a viewer for a list of Connections.
- See also: VConnx for singular viewer
Status
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\Connis 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
- Moved from [WFe]
- 2025-12-04 Renamed from
VConn⇒VConns, to reflect the fact that it's a list.
Code
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 -- //
}