本文整理汇总了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);
}
}