Criteria "NOT IN" Filter

Tach zusammen,

hab mal wieder eine Frage und hoffe das ich mal erhört werde.
Ich suche in der DB nach Produkte die nicht bestimmten IDs entsprechen (NOT IN (…)).

Hier mal das Query dazu: 

SELECT *, HEX(`id`) AS `id`, HEX(`version_id`) AS `version_id`, HEX(`parent_id`) AS `parent_id`, HEX(`parent_version_id`) AS `parent_version_id`, HEX(`tax_id`) AS `tax_id`, HEX(`product_manufacturer_id`) AS `product_manufacturer_id`, HEX(`product_manufacturer_version_id`) AS `product_manufacturer_version_id`, HEX(`delivery_time_id`) AS `delivery_time_id`, HEX(`deliveryTime`) AS `deliveryTime`, HEX(`product_media_id`) AS `product_media_id`, HEX(`product_media_version_id`) AS `product_media_version_id`, HEX(`unit_id`) AS `unit_id`, HEX(`tax`) AS `tax`, HEX(`manufacturer`) AS `manufacturer`, HEX(`cover`) AS `cover`, HEX(`unit`) AS `unit`, HEX(`media`) AS `media`, HEX(`prices`) AS `prices`, HEX(`visibilities`) AS `visibilities`, HEX(`properties`) AS `properties`, HEX(`categories`) AS `categories`, HEX(`translations`) AS `translations`, HEX(`tags`) AS `tags`, HEX(`searchKeywords`) AS `searchKeywords` FROM `product` WHERE HEX(`id`) NOT IN ("00F92ADD7C1F49AD95C2F3672C4606F0", "040C81773F884F44AE5165B20B3DB6AB") LIMIT 4

Ist es möglich ein Criteria dazu zu erstellen z.B.

$criteria = new Criteria();
$criteria->addFilter(new NotInFilter('product.id', ["00F92ADD7C1F49AD95C2F3672C4606F0", "040C81773F884F44AE5165B20B3DB6AB"]));
$criteria->setLimit(4);

$result = $productRepository->search($criteria, $context);

 

$criteria->addFilter(new NotFilter( NotFilter::CONNECTION_AND, new EqualsAnyFilter(‘product.id’, [‘id1’, ‘id2’])));

Sollte so gehen

@Shyim‍

danke, das pass wunderbar.
NotFilter() erwartet ein array im 2ten Parameter. daher sieht der Filter dann so aus.

$products = ['00F92ADD7C1F49AD95C2F3672C4606F0', '040C81773F884F44AE5165B20B3DB6AB'];

if(count($products)){
	$criteria->addFilter(new NotFilter(
		NotFilter::CONNECTION_AND,
		[new EqualsAnyFilter('product.id', $products)]
	));
}
$criteria->setLimit(4)
	->setOffset(0)
	->addSorting(new FieldSorting('product.id', FieldSorting::ASCENDING));

$result = $repository->search($criteria, $context);