<?php

declare(strict_types=1);

namespace App\Framework\Database\Criteria\Expression;

use App\Framework\Database\Criteria\Criterion;

/**
 * BETWEEN expression for range queries
 */
final readonly class BetweenExpression implements Criterion
{
    public function __construct(
        public string $property,
        public mixed  $low,
        public mixed  $high
    ) {
    }

    public function toSql(): string
    {
        return "{$this->property} BETWEEN ? AND ?";
    }

    public function getParameters(): array
    {
        return [$this->low, $this->high];
    }
}
