本文整理汇总了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;
}