/** * Overridden for forcing the package model state. */ public function getRequest() { $request = parent::getRequest(); // Force set the 'package' in the request $request->query->package = $this->getIdentifier()->package; return $request; }
/** * Generic read action, fetches an item * * @param KControllerContextInterface $context A command context object * @throws KControllerExceptionResourceNotFound * @return KModelEntityInterface */ protected function _actionRead(KControllerContextInterface $context) { //Request if ($this->getIdentifier()->domain === 'admin') { if ($this->isEditable() && KStringInflector::isSingular($this->getView()->getName())) { //Use JInput as we do not pass the request query back into the Joomla context JFactory::getApplication()->input->set('hidemainmenu', 1); } } return parent::_actionRead($context); }
/** * Cancel action * * This function will unlock the row(s) and set the redirect to the referrer * * @param KCommandContext A command context object * @return KDatabaseRow A row object containing the data of the cancelled object */ protected function _actionCancel(KCommandContext $context) { //Don't pass through the command chain $row = parent::_actionRead($context); //Create the redirect $this->_redirect = KRequest::get('session.com.controller.referrer', 'url'); return $row; }