table = $table; } /** * Get the current table being used. * * @return string */ public function table(): string { return $this->table; } /** * Get the table name with prefix. * * @return string */ public function table_with_prefix(): string { global $wpdb; return $wpdb->prefix . $this->table; } /** * Get the query builder for this table. * * @return QueryBuilder */ public function qb(): QueryBuilder { return DB::table( $this->table ); } /** * Wrapper for wpdb::get_var * * @see \wpdb::get_var() * * @param string|null $query Optional. SQL query. Defaults to null, use the result from the * previous query. * @param int $x Optional. Column of value to return. Indexed from 0. Default 0. * @param int $y Optional. Row of value to return. Indexed from 0. Default 0. * * @return string|null */ public function get_var( ?string $query = null, int $x = 0, int $y = 0 ): ?string { return DB::get_var( $query, $x, $y ); } }