from($table); } /** * Get the database connection from `$wpdb` */ public static function getConnection(): Connection { if (! isset(self::$connection)) { global $wpdb; self::$connection = new Connection($wpdb->__get('dbh')); Grammar::getInstance()->setTablePrefix($wpdb->prefix); } return self::$connection; } /** * Apply a mixin to builder class */ public static function plugin(Pluggable $plugin): Builder { return (new Builder(self::getConnection()))->plugin($plugin); } /** * Handle dynamic method calling * * @param array $arguments * @return Builder */ public static function __callStatic(string $name, array $arguments) { return self::forwardCallTo(self::getConnection(), $name, $arguments); } }