<?php

namespace KupShop\AdminBundle\Query;

use Query\Operator;

class Invert
{
    public static function checkInvert($operator, $invert, $nullableField = null)
    {
        if (isset($invert) && $invert == 1) {
            if ($nullableField) {
                return Operator::notOrNull($operator, $nullableField);
            }

            return Operator::not($operator);
        }

        return $operator;
    }
}
