240 $db->setQuery($query);
241 $data = $db->loadObject();
242
243 if (empty($data))
244 {
245 throw new \Exception(Text::_('COM_CONTACT_ERROR_CONTACT_NOT_FOUND') . ' ' . $pk, 404);
246 }
247
248 // Check for published state if filter set.
249 if ((is_numeric($published) || is_numeric($archived)) && (($data->published != $published) && ($data->published != $archived)))
250 {