db = self::$_db ??= new Database(); } private ?array $row { get { // Return existing row data if ($this->_resolved) { return $this->_row; } $this->_resolved = true; return $this->_row = $this->db ->from($this->table) ->where($this->where) ->limit(1) ->select($this->columns) ->fetch_assoc() ?? []; } } protected static function create(string $table, array $values): bool { return new Database()->from($table)->insert($values); } public function get(string $key): mixed { return $this->row[$key] ?? null; } public function set(string $key, mixed $value): bool { $this->_row[$key] = $value; return $this->db ->from($this->table) ->where($this->where) ->update([$key => $value]); } }