本文整理匯總了PHP中Current_User::giveItemPermission方法的典型用法代碼示例。如果您正苦於以下問題:PHP Current_User::giveItemPermission方法的具體用法?PHP Current_User::giveItemPermission怎麽用?PHP Current_User::giveItemPermission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Current_User
的用法示例。
在下文中一共展示了Current_User::giveItemPermission方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
public function save()
{
PHPWS_Core::initModClass('search', 'Search.php');
if (!$this->id) {
$new = true;
$this->create_date = time();
} else {
$new = false;
}
$this->last_updated = time();
// If this page has a parent and the order is not set
// then increment
if (!$this->page_order && $this->parent_page) {
$page_order = $this->getLastPage();
if (!PHPWS_Error::logIfError($page_order)) {
$this->page_order = $page_order + 1;
} else {
$this->page_order = 1;
}
}
$db = new PHPWS_DB('ps_page');
if (PHPWS_Error::logIfError($db->saveObject($this))) {
return false;
}
$this->saveKey();
if ($new && Current_User::isRestricted('pagesmith')) {
Current_User::giveItemPermission($this->_key);
}
$search = new Search($this->key_id);
$search->resetKeywords();
$search->addKeywords($this->title);
PHPWS_Error::logIfError($search->save());
foreach ($this->_sections as $section) {
$section->pid = $this->id;
PHPWS_Error::logIfError($section->save($this->key_id));
}
PHPWS_Cache::remove($this->cacheKey());
}