/** * Prepare execute hook. * * @throws \UnexpectedValueException * @return void */ protected function prepareExecute() { parent::prepareExecute(); $this->user = $this->container->get('user'); $this->lang = $this->container->get('language'); $this->model = $this->getModel($this->viewItem); $this->table = $this->model->getTable($this->viewItem, $this->prefix . 'Table'); // Determine model if (!$this->model instanceof CrudModel) { throw new \UnexpectedValueException(sprintf('%s model need extend to CrudModel', $this->name)); } // Determine the name of the primary key for the data. if (empty($this->key)) { $this->key = $this->table->getKeyName(); } // To avoid data collisions the urlVar may be different from the primary key. if (empty($this->urlVar)) { $this->urlVar = $this->key; } }
/** * getTable * * @param string $name * @param string $prefix * @param array $options * * @return JTable */ public function getTable($name = 'User', $prefix = 'JTable', $options = array()) { return parent::getTable($name, $prefix, $options); }