<?php
namespace PixelioCartAbandonRecoveryMore\Includes\Mocks;
if (!defined('ABSPATH')) exit;
class Pixelio_Cart_Abandon_Recovery_More_WPDB
{
	public string $prefix = 'wp_';

	/**
	 * Prepare SQL query (stub)
	 */
	public function prepare(string $query, ...$args): string
	{
		return $query;
	}

	/**
	 * Get a single variable
	 */
	public function get_var(string $query = null, int $x = 0, int $y = 0)
	{
		return null; // mock retourne null par défaut
	}

	/**
	 * Get a single row
	 */
	public function get_row(string $query = null, string $output = 'OBJECT', int $y = 0)
	{
		return null; // mock retourne null par défaut
	}

	/**
	 * Get multiple results
	 */
	public function get_results(string $query = null, string $output = 'OBJECT')
	{
		return []; // mock retourne tableau vide
	}

	/**
	 * Insert a row
	 */
	public int $insert_id = 1;

	public function insert(string $table, array $data, array $format = []): bool
	{
		$this->insert_id++; // simuler un insert
		return true;
	}

	/**
	 * Update a row
	 */
	public function update(string $table,  $data,  $where,  $format,  $where_format): bool
	{
		return true;
	}

	/**
	 * Replace a row
	 */
	public function replace(string $table, array $data, array $format = []): bool
	{
		return true;
	}

	/**
	 * Run a query (DELETE, UPDATE, etc.)
	 */
	public function query(string $query)
	{
		return true;
	}
}
