本文整理匯總了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;
}