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