本文整理匯總了PHP中eZInformationCollection::fetchByUserIdentifier方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZInformationCollection::fetchByUserIdentifier方法的具體用法?PHP eZInformationCollection::fetchByUserIdentifier怎麽用?PHP eZInformationCollection::fetchByUserIdentifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZInformationCollection
的用法示例。
在下文中一共展示了eZInformationCollection::fetchByUserIdentifier方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetchCollectedInfoCollection
static public function fetchCollectedInfoCollection( $collectionID, $contentObjectID )
{
$collection = false;
if ( $collectionID )
$collection = eZInformationCollection::fetch( $collectionID );
else if ( $contentObjectID )
{
$userIdentifier = eZInformationCollection::currentUserIdentifier();
$collection = eZInformationCollection::fetchByUserIdentifier( $userIdentifier, $contentObjectID );
}
return array( 'result' => $collection );
}
示例2:
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);
$tpl->setVariable('node', $node);
$tpl->setVariable('object', $object);