本文整理匯總了PHP中rcube_db::array2list方法的典型用法代碼示例。如果您正苦於以下問題:PHP rcube_db::array2list方法的具體用法?PHP rcube_db::array2list怎麽用?PHP rcube_db::array2list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rcube_db
的用法示例。
在下文中一共展示了rcube_db::array2list方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: explode
/**
* Remove the given contact records from a certain group
*
* @param string Group identifier
* @param array List of contact identifiers to be removed
* @return int Number of deleted group members
*/
function remove_from_group($group_id, $ids)
{
if (!is_array($ids)) {
$ids = explode(self::SEPARATOR, $ids);
}
$ids = $this->db->array2list($ids, 'integer');
$sql_result = $this->db->query("DELETE FROM " . $this->db->table_name($this->db_groupmembers) . " WHERE contactgroup_id=?" . " AND contact_id IN ({$ids})", $group_id);
return $this->db->affected_rows();
}
示例2: IN
/**
* Removes message(s) from cache.
*
* @param string $mailbox Folder name
* @param array $uids Message UIDs, NULL removes all messages
*/
function remove_message($mailbox = null, $uids = null)
{
if (!strlen($mailbox)) {
$this->db->query("DELETE FROM " . $this->db->table_name('cache_messages') . " WHERE user_id = ?", $this->userid);
} else {
// Remove the message from internal cache
if (!empty($uids) && ($message = $this->icache['__message']) && $message['mailbox'] === $mailbox && in_array($message['object']->uid, (array) $uids)) {
$this->icache['__message'] = null;
}
$this->db->query("DELETE FROM " . $this->db->table_name('cache_messages') . " WHERE user_id = ?" . " AND mailbox = ?" . ($uids !== null ? " AND uid IN (" . $this->db->array2list((array) $uids, 'integer') . ")" : ""), $this->userid, $mailbox);
}
}
示例3: IN
/**
* Removes message(s) from cache.
*
* @param string $mailbox Folder name
* @param array $uids Message UIDs, NULL removes all messages
*/
function remove_message($mailbox = null, $uids = null)
{
if (!($this->mode & self::MODE_MESSAGE)) {
return;
}
if (!strlen($mailbox)) {
$this->db->query("DELETE FROM {$this->messages_table}" . " WHERE `user_id` = ?", $this->userid);
} else {
// Remove the message from internal cache
if (!empty($uids) && ($message = $this->icache['__message']) && $message['mailbox'] === $mailbox && in_array($message['object']->uid, (array) $uids)) {
$this->icache['__message'] = null;
}
$this->db->query("DELETE FROM {$this->messages_table}" . " WHERE `user_id` = ?" . " AND `mailbox` = ?" . ($uids !== null ? " AND `uid` IN (" . $this->db->array2list((array) $uids, 'integer') . ")" : ""), $this->userid, $mailbox);
}
}