示例#1
0
 /**
  * Method to store a record
  *
  * @access	public
  * @return	boolean	True on success
  */
 function store()
 {
     $row = $this->getTable();
     $data = JRequest::get('post');
     if ($data['params']) {
         $data['params'] = json_encode($data['params']);
     } else {
         $data['params'] = '';
     }
     // Bind the form fields to the table
     if (!$row->bind($data)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     if ($this->_id == 0) {
         $this->_id = $row->guild_id;
     }
     // Make sure the record is valid
     if (!$row->check()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // Store the web link table to the database
     if (!$row->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     if (@$data['sync_now'] == '1') {
         RaidPlannerHelper::RosterSync($data['guild_id'], 0, true);
     }
     return $row->guild_id;
 }