本文整理汇总了PHP中eZCollaborationItem::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP eZCollaborationItem::fetch方法的具体用法?PHP eZCollaborationItem::fetch怎么用?PHP eZCollaborationItem::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZCollaborationItem
的用法示例。
在下文中一共展示了eZCollaborationItem::fetch方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testApprovalFatalErrorWhenMoving
/**
* Test regression for issue #13952: Workflow cronjob gives fatal error if
* node is moved to different location before approval.
*
* Test Outline
* ------------
* 1. Create a folder
* 2. Approve folder
* 3. Create child of folder
* 4. Approve child
* 5. Create a new version and re-publish the child
* 6. Move child to root
* 7. Approve child
* 8. Run approval cronjob
*
* @result: Fatal error: Call to a member function attribute() on a non-object in
* /www/trunk/kernel/content/ezcontentoperationcollection.php on line 313
* @expected: No fatal error
* @link http://issues.ez.no/13952
*/
public function testApprovalFatalErrorWhenMoving()
{
$anonymousObjectID = eZUser::fetchByName('anonymous')->attribute('contentobject_id');
// STEP 1: Create a folder
$folder = new ezpObject("folder", 2, $anonymousObjectID);
$folder->name = "Parent folder (needs approval)";
$folder->publish();
// STEP 2: Approve folder
$collaborationItem = eZCollaborationItem::fetch(1);
$this->approveCollaborationItem($collaborationItem);
$this->runWorkflow();
// STEP 3: Create child of folder
$child = new ezpObject("folder", $folder->mainNode->node_id, $anonymousObjectID);
$child->name = "Child folder (needs approval)";
$child->publish();
// STEP 4: Approve child
$collaborationItem = eZCollaborationItem::fetch(2);
$this->approveCollaborationItem($collaborationItem);
$this->runWorkflow();
// STEP 5: Re-publish child
$newVersion = $child->createNewVersion();
ezpObject::publishContentObject($child->object, $newVersion);
// STEP 6: Move child to root
$child->mainNode->move(2);
// STEP 7: Approve child again
$collaborationItem = eZCollaborationItem::fetch(3);
$this->approveCollaborationItem($collaborationItem);
// STEP 8: Run approval cronjob
$this->runWorkflow();
}
示例2: collaborationItem
function collaborationItem()
{
if (isset($this->CollaborationID) and $this->CollaborationID) {
return eZCollaborationItem::fetch($this->CollaborationID, $this->UserID);
}
return null;
}
示例3: checkApproveCollaboration
function checkApproveCollaboration( $process, $event )
{
$db = eZDb::instance();
$taskResult = $db->arrayQuery( 'select workflow_process_id, collaboration_id from ezapprove_items where workflow_process_id = ' . $process->attribute( 'id' ) );
$collaborationID = $taskResult[0]['collaboration_id'];
$collaborationItem = eZCollaborationItem::fetch( $collaborationID );
$contentObjectVersion = eZApproveCollaborationHandler::contentObjectVersion( $collaborationItem );
$approvalStatus = eZApproveCollaborationHandler::checkApproval( $collaborationID );
if ( $approvalStatus == eZApproveCollaborationHandler::STATUS_WAITING )
{
eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'approval still waiting' );
return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
}
else if ( $approvalStatus == eZApproveCollaborationHandler::STATUS_ACCEPTED )
{
eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'approval was accepted' );
$status = eZWorkflowType::STATUS_ACCEPTED;
}
else if ( $approvalStatus == eZApproveCollaborationHandler::STATUS_DENIED or
$approvalStatus == eZApproveCollaborationHandler::STATUS_DEFERRED )
{
eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, 'approval was denied' );
$contentObjectVersion->setAttribute( 'status', eZContentObjectVersion::STATUS_DRAFT );
$status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
else
{
eZDebugSetting::writeDebug( 'kernel-workflow-approve', $event, "approval unknown status '$approvalStatus'" );
$contentObjectVersion->setAttribute( 'status', eZContentObjectVersion::STATUS_REJECTED );
$status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
$contentObjectVersion->sync();
if ( $approvalStatus != eZApproveCollaborationHandler::STATUS_DEFERRED )
$db->query( 'DELETE FROM ezapprove_items WHERE workflow_process_id = ' . $process->attribute( 'id' ) );
return $status;
}
示例4: eventContent
function eventContent($event)
{
return eZCollaborationItem::fetch($event->attribute('data_int1'));
}
示例5: array
/**
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://ez.no/Resources/Software/Licenses/eZ-Business-Use-License-Agreement-eZ-BUL-Version-2.1 eZ Business Use License Agreement eZ BUL Version 2.1
* @version 4.7.0
* @package kernel
*/
$Module = $Params['Module'];
$ViewMode = $Params['ViewMode'];
$ItemID = $Params['ItemID'];
$Offset = $Params['Offset'];
if ( !is_numeric( $Offset ) )
$Offset = 0;
$collabItem = eZCollaborationItem::fetch( $ItemID );
if ( $collabItem === null )
return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
$collabHandler = $collabItem->handler();
$collabItem->handleView( $ViewMode );
$template = $collabHandler->template( $ViewMode );
$collabTitle = $collabItem->title();
$viewParameters = array( 'offset' => $Offset );
$tpl = eZTemplate::factory();
$tpl->setVariable( 'view_parameters', $viewParameters );
$tpl->setVariable( 'collab_item', $collabItem );
示例6: participantRoleString
function participantRoleString()
{
if ($this->ParticipantRole < self::ROLE_CUSTOM) {
return eZCollaborationItemParticipantLink::roleString($this->ParticipantRole);
}
$item = eZCollaborationItem::fetch($this->CollaborationID);
return $item->attribute('type_identifier') . '_' . $item->handler()->participantRoleString($this->ParticipantRole);
}
示例7: activateApproval
static function activateApproval($approvalID)
{
$collaborationItem = eZCollaborationItem::fetch($approvalID);
if ($collaborationItem !== null) {
$collaborationItem->setAttribute('data_int3', self::STATUS_WAITING);
$collaborationItem->setAttribute('status', eZCollaborationItem::STATUS_ACTIVE);
$timestamp = time();
$collaborationItem->setAttribute('modified', $timestamp);
$collaborationItem->store();
$participantList = eZCollaborationItemParticipantLink::fetchParticipantList(array('item_id' => $approvalID));
foreach ($participantList as $participantLink) {
$collaborationItem->setIsActive(true, $participantLink->attribute('participant_id'));
}
return true;
}
return false;
}
示例8: attribute
function attribute($attr, $noFunction = false)
{
$retVal = false;
switch ($attr) {
case 'approve_status_name':
$nameMap = $this->statusNameMap();
$retVal = $nameMap[$this->attribute('approve_status')];
break;
case 'num_approvers':
$retVal = count($this->approveUserList());
break;
case 'collaboration_item':
#include_once( 'kernel/classes/ezcollaborationitem.php' );
$retVal = eZCollaborationItem::fetch($this->attribute('collaborationitem_id'));
break;
case 'workflow_process':
#include_once( 'kernel/classes/ezworkflowprocess.php' );
$retVal = eZWorkflowProcess::fetch($this->attribute('workflowprocess_id'));
break;
case 'user_approve_status':
$retVal = eZXApproveStatusUserLink::fetchByUserID(eZUser::currentUserID(), $this->attribute('id'), eZXApproveStatusUserLink::RoleApprover);
break;
case 'num_approve_required':
$eventData = $this->attribute('approve2_event');
if ($eventData) {
$retVal = $eventData->attribute('require_all_approve') ? $this->attribute('num_approvers') : 1;
}
break;
case 'contentobject':
$retVal = eZContentObject::fetch($this->attribute('contentobject_id'));
break;
default:
$retVal = eZPersistentObject::attribute($attr);
break;
}
return $retVal;
}
示例9: checkApproveCollaboration
function checkApproveCollaboration($process, $event, $collaborationID = 0)
{
$db = eZDb::instance();
if ($collaborationID > 0) {
$taskResult = $db->arrayQuery('select workflow_process_id, collaboration_id, target_node_ids from ezxapprovelocation_items where collaboration_id = ' . $collaborationID);
} else {
$taskResult = $db->arrayQuery('select workflow_process_id, collaboration_id, target_node_ids from ezxapprovelocation_items where workflow_process_id = ' . $process->attribute('id'));
}
$collaborationID = $taskResult[0]['collaboration_id'];
$collaborationItem = eZCollaborationItem::fetch($collaborationID);
$approvalStatus = approveLocationCollaborationHandler::checkApproval($collaborationID);
$targetNodeIDs = json_decode($taskResult[0]['target_node_ids']);
if ($approvalStatus == approveLocationCollaborationHandler::STATUS_WAITING) {
eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approval still waiting');
return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
} elseif ($approvalStatus == approveLocationCollaborationHandler::STATUS_ACCEPTED) {
eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approval was accepted');
eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $targetNodeIDs, 'add new location(s)');
return eZWorkflowType::STATUS_ACCEPTED;
} elseif ($approvalStatus == approveLocationCollaborationHandler::STATUS_DENIED or $approvalStatus == approveLocationCollaborationHandler::STATUS_DEFERRED) {
eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, 'approval was denied');
$status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
} else {
eZDebugSetting::writeDebug('ezworkflowcollection-workflow-approve-location', $event, "approval unknown status '{$approvalStatus}'");
$status = eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
if ($approvalStatus != approveLocationCollaborationHandler::STATUS_DEFERRED) {
$db->query('DELETE FROM ezxapprovelocation_items WHERE workflow_process_id = ' . $process->attribute('id'));
}
return $status;
}