<?php

declare(strict_types=1);

namespace App\Framework\Database\Criteria\Expression;

use App\Framework\Database\Criteria\Criterion;

/**
 * NOT expression for negating criteria
 */
final readonly class NotExpression implements Criterion
{
    public function __construct(
        public Criterion $criterion
    ) {
    }

    public function toSql(): string
    {
        return "NOT ({$this->criterion->toSql()})";
    }

    public function getParameters(): array
    {
        return $this->criterion->getParameters();
    }
}
