Loop through an entry's fields and if the field type is "Categories" get that fields value/s
I believe I have found the answer.

if(array_key_exists('byCategory', $filterAttributes))
{
  foreach ($entry-&gt;getFieldLayout()-&gt;getFields() as $key) 
  {
      $field = $key-&gt;getField();
      if($field-&gt;type == "Categories"){

         if(!$this-&gt;addFilterdCategories($entry[$field-&gt;handle],$filterAttributes))
         {
             continue;
         }
      }
   }
}