Not obtaining user role as defined.

The method get_object_id() returned value ( $row[0] ) obtained from the SQL query was giving an error ?.

Code adjusted to return $row['id'] instead of $row[0]
Modified add_clause()

Adjusted $clauseI and $valueI to be passed to dprint() as the original values where sometimes array and generating Php E_NOTICE