/** * Returns the model for the current $action. * * The parameters allow you to easily adapt the model to the current action. The $detailed * parameter was added, because the most common use of action is a split between detailed * and summarized actions. * * @return \MUtil_Model_ModelAbstract */ protected function getModel() { $request = $this->getRequest(); $action = null === $request ? '' : $request->getActionName(); // Only get new model if there is no model or the model was for a different action if (!($this->_model && $this->_model->isMeta('action', $action))) { $detailed = !$this->isSummarized($action); \MUtil_Model::getSource()->addRegistryContainer(array('action' => $action, 'detailed' => $detailed, 'forForm' => $this->forForm($action)), 'actionVariables'); $this->_model = $this->createModel($detailed, $action); $this->_model->setMeta('action', $action); // Detailed models DO NOT USE $_POST for filtering, // multirow models DO USE $_POST parameters for filtering. $this->_model->applyRequest($request, $detailed, $this->includeNumericFilters); } return $this->_model; }