當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZCollaborationItem::create方法代碼示例

本文整理匯總了PHP中eZCollaborationItem::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZCollaborationItem::create方法的具體用法?PHP eZCollaborationItem::create怎麽用?PHP eZCollaborationItem::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZCollaborationItem的用法示例。


在下文中一共展示了eZCollaborationItem::create方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createApproval

 static function createApproval($contentObjectID, $contentObjectVersion, $authorID, $approverIDArray)
 {
     $collaborationItem = eZCollaborationItem::create('ezapprove', $authorID);
     $collaborationItem->setAttribute('data_int1', $contentObjectID);
     $collaborationItem->setAttribute('data_int2', $contentObjectVersion);
     $collaborationItem->setAttribute('data_int3', false);
     $collaborationItem->store();
     $collaborationID = $collaborationItem->attribute('id');
     $participantList = array(array('id' => array($authorID), 'role' => eZCollaborationItemParticipantLink::ROLE_AUTHOR), array('id' => $approverIDArray, 'role' => eZCollaborationItemParticipantLink::ROLE_APPROVER));
     foreach ($participantList as $participantItem) {
         foreach ($participantItem['id'] as $participantID) {
             $participantRole = $participantItem['role'];
             $link = eZCollaborationItemParticipantLink::create($collaborationID, $participantID, $participantRole, eZCollaborationItemParticipantLink::TYPE_USER);
             $link->store();
             $profile = eZCollaborationProfile::instance($participantID);
             $groupID = $profile->attribute('main_group');
             eZCollaborationItemGroupLink::addItem($groupID, $collaborationID, $participantID);
         }
     }
     // Create the notification
     $collaborationItem->createNotificationEvent();
     return $collaborationItem;
 }
開發者ID:EVE-Corp-Center,項目名稱:ECC-Website,代碼行數:23,代碼來源:ezapprovecollaborationhandler.php


注:本文中的eZCollaborationItem::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。