/** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * @param boolean $forceNew Force get new model, or we get it from cache. * * @return object The model. */ public function getModel($name = null, $prefix = null, $config = array(), $forceNew = false) { if (!$name) { $name = $this->viewItem; } return parent::getModel($name, $prefix, $config); }
/** * Prepare execute hook. * * @return void */ protected function prepareExecute() { $this->context = ContextHelper::fromController($this, 'edit'); parent::prepareExecute(); $this->recordId = $this->input->get($this->urlVar); // Populate the row id from the session. $this->data[$this->key] = $this->recordId; }