本文整理匯總了PHP中eZInformationCollection::userDataHandling方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZInformationCollection::userDataHandling方法的具體用法?PHP eZInformationCollection::userDataHandling怎麽用?PHP eZInformationCollection::userDataHandling使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZInformationCollection
的用法示例。
在下文中一共展示了eZInformationCollection::userDataHandling方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
}
if (!$object->attribute('can_read')) {
return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
}
$version = $object->currentVersion();
$contentObjectAttributes = $version->contentObjectAttributes();
$user = eZUser::currentUser();
$isLoggedIn = $user->attribute('is_logged_in');
$allowAnonymous = true;
if (!$isLoggedIn) {
$allowAnonymous = eZInformationCollection::allowAnonymous($object);
}
$newCollection = false;
$collection = false;
$userDataHandling = eZInformationCollection::userDataHandling($object);
if ($userDataHandling == 'unique' or $userDataHandling == 'overwrite') {
$collection = eZInformationCollection::fetchByUserIdentifier(eZInformationCollection::currentUserIdentifier(), $object->attribute('id'));
}
if (!$isLoggedIn and !$allowAnonymous or $userDataHandling == 'unique' and $collection) {
$tpl = eZTemplate::factory();
$attributeHideList = eZInformationCollection::attributeHideList();
$informationCollectionTemplate = eZInformationCollection::templateForObject($object);
$node = eZContentObjectTreeNode::fetch($NodeID);
$collectionID = false;
if ($collection) {
$collectionID = $collection->attribute('id');
}
$tpl->setVariable('node_id', $node->attribute('node_id'));
$tpl->setVariable('collection_id', $collectionID);
$tpl->setVariable('collection', $collection);