For an array passed with values
$tags = ['tag1','tag2','foo','bar']
the resulting $query
will be
SELECT * FROM (
SELECT
p.id
, p.name
, p.img_
, CASE WHEN c.category = 'wine' THEN 'wine'
WHEN c.type IN ('Single malt', 'Whisky') THEN 'whiskey'
END AS `category`
FROM ilbettija.products p
JOIN ilbettija.productscattype c
ON (p.type = c.type)
WHERE p.id IN (
SELECT DISTINCT k.prodID
FROM ilbettija.keywords k
WHERE ((k.keyword = :tag0) OR (k.keyword = :tag1) OR (k.keyword = :tag2) OR (k.keyword = :tag3))
)
AND p.inStock = 'Y'
) prk
WHERE prk.category = :category