32 if ($this->db ===
null) {
35 $this->db->manipulate(
"TRUNCATE TABLE " . self::TABLE_NAME);
40 if ($this->db ===
null) {
56 $node =
new Node($host, $port, $weight);
57 if ($this->db !=
null) {
58 $next_id = $this->db->nextId(self::TABLE_NAME);
59 $this->db->insert(self::TABLE_NAME, [
60 "id" => [
"integer", $next_id],
61 "status" => [
"integer",
true],
62 "host" => [
"text", $node->getHost()],
63 "port" => [
"integer", $node->getPort()],
64 "weight" => [
"integer", $node->getWeight()],
65 "flush_needed" => [
"integer",
false]
73 if ($this->db ===
null) {
76 $set = $this->db->query(
"SELECT * FROM " . self::TABLE_NAME);
78 while ($rec = $this->db->fetchAssoc($set)) {
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(private ?ilDBInterface $db=null)
create(string $host, int $port, int $weight)