コード例 #1
0
 /**
  * Saves the data from the object into the specified database tables
  *
  * @param	boolean	Do the query?
  * @param	mixed		Whether to run the query now; see db_update() for more info
  * @param bool 		Whether to return the number of affected rows.
  *
  * @return	mixed	If this was an INSERT query, the INSERT ID is returned
  */
 function save($doquery = true, $delayed = false, $affected_rows = false)
 {
     // Specify a REPLACE INTO insert with the 'true' parameter at the end
     return parent::save($doquery, $delayed, $affected_rows, true);
 }
コード例 #2
0
ファイル: class_dm_ip_data.php プロジェクト: 0hyeah/yurivn
 /**
  * Saves the data from the object into the specified database tables
  *
  * We change the default for $replace to true, and then call the parent.
  */
 function save($doquery = true, $delayed = false, $affected_rows = false, $replace = true, $ignore = false)
 {
     // We default $replace to true, and then call the parent.
     return parent::save($doquery, $delayed, $affected_rows, $replace, $ignore);
 }
コード例 #3
0
ファイル: class_dm_forum.php プロジェクト: hungnv0789/vhtm
	/**
	 * Overridding parent function to add search index updates
	 *
	* @param	boolean	Do the query?
	* @param	mixed	Whether to run the query now; see db_update() for more info
	* @param 	bool 	Whether to return the number of affected rows.
	* @param 	bool	Perform REPLACE INTO instead of INSERT
	8 @param 	bool	Perfrom INSERT IGNORE instead of INSERT
	*
	* @return	mixed	If this was an INSERT query, the INSERT ID is returned
	*/
	function save($doquery = true, $delayed = false, $affected_rows = false, $replace = false, $ignore = false)
	{
		// Call and get the new id
		$result = parent::save($doquery, $delayed, $affected_rows, $replace, $ignore);
		require_once DIR . '/vb/search/indexcontroller/queue.php' ;
		// Search index maintenance
		vb_Search_Indexcontroller_Queue::indexQueue('vBForum', 'Forum', 'index',
			  $this->fetch_field('forumid'));

		return $result;
	}
コード例 #4
0
 /**
  * Overridding parent function to add search index updates
  *
  * @param	boolean	Do the query?
  * @param	mixed	Whether to run the query now; see db_update() for more info
  * @param 	bool 	Whether to return the number of affected rows.
  * @param 	bool	Perform REPLACE INTO instead of INSERT
  * @param 	bool	Perfrom INSERT IGNORE instead of INSERT
  *
  * @return	mixed	If this was an INSERT query, the INSERT ID is returned
  */
 function save($doquery = true, $delayed = false, $affected_rows = false, $replace = false, $ignore = false)
 {
     // Call and get the new id
     $result = parent::save($doquery, $delayed, $affected_rows, $replace, $ignore);
     // Search index maintenance
     if ($result and ($this->groupmessage['discussionid'] or $this->existing['discussionid'])) {
         // If result is the number (opposed to just TRUE) then use that, or which ever of the others is a number
         $do = is_bool($result) == true ? is_numeric($this->existing['gmid']) == true ? $this->existing['gmid'] : $this->existing['discussionid'] : $result;
         vb_Search_Indexcontroller_Queue::indexQueue('vBForum', 'SocialGroupMessage', 'index', $do);
     }
     return $result;
 }