当前位置: 首页>>代码示例>>PHP>>正文


PHP eZContentOperationCollection::setVersionStatus方法代码示例

本文整理汇总了PHP中eZContentOperationCollection::setVersionStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentOperationCollection::setVersionStatus方法的具体用法?PHP eZContentOperationCollection::setVersionStatus怎么用?PHP eZContentOperationCollection::setVersionStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZContentOperationCollection的用法示例。


在下文中一共展示了eZContentOperationCollection::setVersionStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkContentActions


//.........这里部分代码省略.........
                                        array( 'class_identifier', $class->attribute( 'identifier' ) ),
                                        array( 'class_group', $class->attribute( 'match_ingroup_id_list' ) ) ) );

                    $tpl->setVariable( 'edit_language', $EditLanguage );
                    $tpl->setVariable( 'current_version', $version->attribute( 'version' ) );
                    $tpl->setVariable( 'object', $object );
                    $tpl->setVariable( 'draft_versions', $conflictingVersions );

                    $Result = array();
                    $Result['content'] = $tpl->fetch( 'design:content/edit_conflict.tpl' );
                    return eZModule::HOOK_STATUS_CANCEL_RUN;
                }
            }

            eZDebug::accumulatorStart( 'publish', '', 'publish' );
            $oldObjectName = $object->name();

            $behaviour = new ezpContentPublishingBehaviour();
            $behaviour->isTemporary = true;
            $behaviour->disableAsynchronousPublishing = false;
            ezpContentPublishingBehaviour::setBehaviour( $behaviour );

            $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $object->attribute( 'id' ),
                                                                                         'version' => $version->attribute( 'version' ) ) );
            eZDebug::accumulatorStop( 'publish' );

            if ( ( array_key_exists( 'status', $operationResult ) && $operationResult['status'] != eZModuleOperationInfo::STATUS_CONTINUE ) )
            {
                eZDebug::writeDebug( $operationResult, __FILE__ );
                switch( $operationResult['status'] )
                {
                    case eZModuleOperationInfo::STATUS_REPEAT:
                    {
                        eZContentOperationCollection::setVersionStatus( $object->attribute( 'id' ),
                            $version->attribute( 'version' ), eZContentObjectVersion::STATUS_REPEAT );
                    }
                    case eZModuleOperationInfo::STATUS_HALTED:
                    {
                        if ( isset( $operationResult['redirect_url'] ) )
                        {
                            $module->redirectTo( $operationResult['redirect_url'] );
                            return;
                        }
                        else if ( isset( $operationResult['result'] ) )
                        {
                            $result = $operationResult['result'];
                            $resultContent = false;
                            if ( is_array( $result ) )
                            {
                                if ( isset( $result['content'] ) )
                                {
                                    $resultContent = $result['content'];
                                }
                                if ( isset( $result['path'] ) )
                                {
                                    $Result['path'] = $result['path'];
                                }
                            }
                            else
                            {
                                $resultContent = $result;
                            }
                            // Temporary fix to make approval workflow work with edit.
                            if ( strpos( $resultContent, 'Deffered to cron' ) === 0 )
                            {
                                $Result = null;
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:67,代码来源:edit.php

示例2: executeTrigger

 /**
  * Executes an operation trigger
  *
  * @param array $bodyReturnValue The current return value
  * @param array $body Body data for the trigger being executed
  * @param array $operationParameterDefinitions Operation parameters definition
  * @param array $operationParameters Operation parameters values
  * @param int $bodyCallCount Number of times the body was called
  * @param array $currentLoopData Memento data for the operation
  * @param bool $triggerRestored Boolean that indicates if operation data (memento) was restored
  * @param string $operationName The operation name
  * @param array $operationKeys Additional parameters. Only used by looping so far.
  * @return
  */
 function executeTrigger(&$bodyReturnValue, $body, $operationParameterDefinitions, $operationParameters, &$bodyCallCount, $currentLoopData, $triggerRestored, $operationName, &$operationKeys)
 {
     $triggerName = $body['name'];
     $triggerKeys = $body['keys'];
     $status = eZTrigger::runTrigger($triggerName, $this->ModuleName, $operationName, $operationParameters, $triggerKeys);
     if ($status['Status'] == eZTrigger::WORKFLOW_DONE || $status['Status'] == eZTrigger::NO_CONNECTED_WORKFLOWS) {
         ++$bodyCallCount['loop_run'][$triggerName];
         return eZModuleOperationInfo::STATUS_CONTINUE;
     } else {
         if ($status['Status'] == eZTrigger::STATUS_CRON_JOB || $status['Status'] == eZTrigger::FETCH_TEMPLATE || $status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT || $status['Status'] == eZTrigger::REDIRECT) {
             $bodyMemento = $this->storeBodyMemento($triggerName, $triggerKeys, $operationKeys, $operationParameterDefinitions, $operationParameters, $bodyCallCount, $currentLoopData, $operationName);
             $workflowProcess = $status['WorkflowProcess'];
             if ($workflowProcess !== null) {
                 $workflowProcess->setAttribute('memento_key', $bodyMemento->attribute('memento_key'));
                 $workflowProcess->store();
             }
             $bodyReturnValue['result'] = $status['Result'];
             if ($status['Status'] == eZTrigger::REDIRECT) {
                 $bodyReturnValue['redirect_url'] = $status['Result'];
             }
             if ($status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT) {
                 // Hack for project issue #14371 (fetch template repeat)
                 // The object version's status is set to REPEAT so that it can
                 // be submitted again
                 if ($operationName == 'publish' && $this->ModuleName == 'content') {
                     eZContentOperationCollection::setVersionStatus($operationParameters['object_id'], $operationParameters['version'], eZContentObjectVersion::STATUS_REPEAT);
                 }
                 return eZModuleOperationInfo::STATUS_REPEAT;
             } else {
                 return eZModuleOperationInfo::STATUS_HALTED;
             }
         } else {
             if ($status['Status'] == eZTrigger::WORKFLOW_CANCELLED or $status['Status'] == eZTrigger::WORKFLOW_RESET) {
                 return eZModuleOperationInfo::STATUS_CANCELLED;
                 $bodyReturnValue['result'] = $status['Result'];
             }
         }
     }
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:53,代码来源:ezmoduleoperationinfo.php


注:本文中的eZContentOperationCollection::setVersionStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。