SQLSTATE[42804]: Datatype mismatch: 7 ERROR: argument of AND must be type boolean, not type integer LINE 1: ..._album_id = u2.id WHERE (u.entity_type_id = 2 AND u.entity_i... ^