Example #1
0
 function store()
 {
     $data = JRequest::get('post');
     if (!isset($data['id'])) {
         require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'general.php';
         $data['ordering'] = generalHelpers::getMaxOrder('#__wedding_apps') + 1;
     }
     $row = $this->getTable('apps');
     if (!$row->bind($data)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     if (!$row->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     JRequest::setVar('apply_id', $row->id);
     return true;
 }