213 $db->setQuery($query);
214
215 $data = $db->loadObject();
216
217 if (empty($data)) {
218 throw new \Exception(Text::_('COM_CONTENT_ERROR_ARTICLE_NOT_FOUND'), 404);
219 }
220
221 // Check for published state if filter set.
222 if ((is_numeric($published) || is_numeric($archived)) && ($data->state != $published && $data->state != $archived)) {
223 throw new \Exception(Text::_('COM_CONTENT_ERROR_ARTICLE_NOT_FOUND'), 404);