本文整理匯總了PHP中CB\User::getUserHomeFolderId方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::getUserHomeFolderId方法的具體用法?PHP User::getUserHomeFolderId怎麽用?PHP User::getUserHomeFolderId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CB\User
的用法示例。
在下文中一共展示了User::getUserHomeFolderId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEmailFolderId
/**
* get email folder id for specified user id. If folder does not exist it is created automaticly.
* @param int $user_id
* @return int email folder id
*/
public static function getEmailFolderId($user_id = false)
{
$rez = null;
if (empty($user_id)) {
$user_id = $_SESSION['user']['id'];
}
$pid = User::getUserHomeFolderId($user_id);
$res = DB\dbQuery('SELECT id
FROM tree
WHERE user_id = $1
AND SYSTEM = 1
AND pid =$2
AND type = 1', array($_SESSION['user']['id'], $pid)) or die(DB\dbQueryError());
if ($r = $res->fetch_assoc()) {
$rez = $r['id'];
}
$res->close();
if (empty($rez)) {
DB\dbQuery('INSERT INTO tree (
pid
,user_id
,`system`
,`type`
,`name`
,cid
,uid
,template_id)
VALUES (
$1
,$2
,1
,1
,\'[Emails]\'
,$3
,$3
,$4)', array($pid, $user_id, $_SESSION['user']['id'], Config::get('default_folder_template'))) or die(DB\dbQueryError());
$rez = DB\dbLastInsertId();
Solr\Client::runCron();
}
return $rez;
}