Query entries relatedTo multiple categories in controller
You need to pass an array of element IDs, where the first index is "and" – just like in your template (Twig) code – to targetElement. Basically, this just means that you need to prepend the string "and" to your array of IDs.

Something like this should do it:

...

$prodCriteria-&gt;relatedTo = array(
    'targetElement' =&gt; array_merge(['and'], $catIds),
);