getIdentity(); if (!$user->authorise('core.edit.state', 'com_testquestions') && !$user->authorise('core.edit', 'com_testquestions')) { throw new \RuntimeException(Text::_('JERROR_ALERTNOAUTHOR'), 403); } $db = Factory::getContainer()->get('DatabaseDriver'); $db->setQuery( $db->getQuery(true) ->update($db->quoteName('#__testquestions_sets')) ->set($db->quoteName('published') . ' = 0') ->where($db->quoteName('published') . ' = 1') )->execute(); $this->setRedirect( Route::_('index.php?option=com_testquestions&view=sets', false), Text::sprintf('COM_TESTQUESTIONS_SETS_UNPUBLISHED_ALL', $db->getAffectedRows()) ); } public function getModel($name = 'Set', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } }