Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Create JTable, yourModelName.xml for form in models/forms/ then in your view.html.php get form $this->form = $this->get('Form'), get item $this->item = $this->get('Item') and if form will not be filled just do $this->form->bind($this->item) and all of the form will be in your scope of data jform or other as you wish in model->getForm() method
You should propagate JTable for this case ; ) if(JTable->load([$key => $value]))return true if record exists and false if record not exists then you can use ->store to insert / update record.