public function get() { // Set the user doing the request as if they were authenticated in Joomla ApiHelper::setSessionUser(); if (!defined('K2_JVERSION')) { define('K2_JVERSION', '16'); } // Get the list of items $items = $this->getData(); if (!$items && $this->getError()) { $response = $this->getErrorResponse(400, $this->getError()); } else { $response = $items; } $this->plugin->setResponse($response); }