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


PHP eZContentObjectVersion::fetchVersion方法代码示例

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


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

示例1: add

 /**
  * Adds a draft to the publishing queue
  *
  * @param int $objectId
  * @param int $version
  *
  * @return ezpContentPublishingProcess
  */
 public static function add($objectId, $version)
 {
     self::init();
     self::signals()->emit('preQueue', $version, $objectId);
     $processObject = ezpContentPublishingProcess::queue(eZContentObjectVersion::fetchVersion($version, $objectId));
     return $processObject;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:15,代码来源:ezpcontentpublishingqueue.php

示例2: getCollectionData

    /**
     * @deprecated since eZ Find 2.1
     * Get collection data. Returns list of ezfSolrDocumentFieldBase documents.
     *
     * @return array List of ezfSolrDocumentFieldBase objects.
     */
    public function getCollectionData()
    {
        $returnList = array();
        switch( $this->ContentObjectAttribute->attribute( 'data_type_string' ) )
        {
            case 'ezobjectrelation':
            {
                $returnList = $this->getBaseList( $this->ContentObjectAttribute->attribute( 'object_version' ) );
            } break;

            case 'ezobjectrelationlist':
            {
                $content = $this->ContentObjectAttribute->content();
                foreach ( $content['relation_list'] as $relationItem )
                {
                    $subObjectID = $relationItem['contentobject_id'];
                    if ( !$subObjectID )
                        continue;
                    $subObject = eZContentObjectVersion::fetchVersion( $relationItem['contentobject_version'], $subObjectID );
                    if ( !$subObject )
                        continue;

                    $returnList = array_merge( $this->getBaseList( $subObject ),
                                               $returnList );
                }
            } break;
        }

        return $returnList;
    }
开发者ID:ataxel,项目名称:tp,代码行数:36,代码来源:ezfsolrdocumentfieldobjectrelation.php

示例3: testLinksAcrossTranslations

 /**
  * Test scenario for issue #13492: Links are lost after removing version
  *
  * Test Outline
  * ------------
  * 1. Create a Folder in English containing a link (in the short_description attribute).
  * 2. Translate Folder into Norwegian containing another link (not the same link as above.)
  * 3. Remove Folder version 1. (Version 2 is created when translating).
  *
  * @result: short_description in version 2 will have an empty link.
  * @expected: short_description should contain same link as in version 1.
  * @link http://issues.ez.no/13492
  */
 public function testLinksAcrossTranslations()
 {
     ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'ContentObjectLocale', 'eng-GB');
     $xmlDataEng = '<link href="/some-where-random">a link</link>';
     $xmlDataNor = '<link href="/et-tilfeldig-sted">en link</link>';
     // Step 1: Create folder
     $folder = new ezpObject("folder", 2);
     $folder->name = "Folder Eng";
     $folder->short_description = $xmlDataEng;
     $folder->publish();
     $version1Xml = $folder->short_description->attribute('output')->attribute('output_text');
     // Step 2: Translate folder
     $trData = array("name" => "Folder Nor", "short_description" => $xmlDataNor);
     $folder->addTranslation("nor-NO", $trData);
     // addTranslation() publishes too.
     // Step 3: Remove version 1
     $version1 = eZContentObjectVersion::fetchVersion(1, $folder->id);
     $version1->removeThis();
     // Grab current versions data and make sure it's fresh.
     $folder->refresh();
     $version2Xml = $folder->short_description->attribute('output')->attribute('output_text');
     $folder->remove();
     ezpINIHelper::restoreINISettings();
     self::assertEquals($version1Xml, $version2Xml);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:38,代码来源:ezxmltext_regression.php

示例4: status

    public static function status( $args )
    {
        if ( count( $args ) != 2 )
        {
            throw new ezcBaseFunctionalityNotSupportedException( 'status', 'Missing argument(s)' );
        }

        list( $contentObjectId, $version ) = $args;

        $process = ezpContentPublishingProcess::fetchByContentObjectVersion( $contentObjectId, $version );

        // No process: check if the object's still a draft
        // @todo Change to a PENDING check when applied (operation => step 2)
        if ( $process instanceof ezpContentPublishingProcess )
        {
            $return = array();
            $status = $process->attribute( 'status' ) == ezpContentPublishingProcess::STATUS_WORKING ? 'working' : 'finished';
            switch( $process->attribute( 'status' ) )
            {
                case ezpContentPublishingProcess::STATUS_WORKING:
                    $status = 'working';
                    break;

                case ezpContentPublishingProcess::STATUS_FINISHED:
                    $status = 'finished';
                    $objectVersion = $process->attribute( 'version' );
                    $object = $objectVersion->attribute( 'contentobject' );
                    $node = $object->attribute( 'main_node' );
                    $uri = $node->attribute( 'url_alias' );
                    eZURI::transformURI( $uri );
                    $return['node_uri'] = $uri;
                    break;

                case ezpContentPublishingProcess::STATUS_PENDING:
                    $status = 'pending';
                    break;

                case ezpContentPublishingProcess::STATUS_DEFERRED:
                    $status = 'deferred';
                    $versionViewUri = "content/versionview/{$contentObjectId}/{$version}";
                    eZURI::transformURI( $versionViewUri );
                    $return['versionview_uri'] = $versionViewUri;
                    break;
            }
            $return['status'] = $status;
        }
        else
        {
            $version = eZContentObjectVersion::fetchVersion( $version, $contentObjectId );
            if ( $version === null )
                throw new ezcBaseFunctionalityNotSupportedException( 'status', 'Object version not found' );
            else
                $return = array( 'status' =>  'queued' );
        }

        return $return;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:57,代码来源:ezjscserverfunctionspublishingqueue.php

示例5: fetchByContentObjectVersion

 /**
  * Fetches a process by its content object ID + version
  * @param int $contentObjectId
  * @param int $version
  * @return ezpContentPublishingProcess
  */
 public static function fetchByContentObjectVersion($contentObjectId, $version)
 {
     $contentObjectVersion = eZContentObjectVersion::fetchVersion($version, $contentObjectId);
     if ($contentObjectVersion instanceof eZContentObjectVersion) {
         $return = self::fetchByContentVersionId($contentObjectVersion->attribute('id'));
         return $return;
     } else {
         return false;
     }
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:16,代码来源:ezpcontentpublishingprocess.php

示例6: fetchNonTranslationList

 public static function fetchNonTranslationList($objectID, $version)
 {
     $version = eZContentObjectVersion::fetchVersion($version, $objectID);
     if (!$version) {
         return array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
     }
     $nonTranslationList = $version->nonTranslationList();
     if ($nonTranslationList === null) {
         return array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
     }
     return array('result' => $nonTranslationList);
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:12,代码来源:ezcontentfunctioncollection.php

示例7: execute

 public function execute($process, $event)
 {
     $processParameters = $process->attribute('parameter_list');
     $object = eZContentObject::fetch($processParameters['object_id']);
     $node = $object->mainNode();
     $href = '/push/node/' . $node->attribute('node_id');
     $version = eZContentObjectVersion::fetchVersion($processParameters['version'], $processParameters['object_id']);
     if ($version instanceof eZContentObjectVersion) {
         $language = eZContentLanguage::fetch($version->attribute('initial_language_id'));
         if ($language instanceof eZContentLanguage) {
             $href .= '/' . $language->attribute('locale');
         }
     }
     eZURI::transformURI($href, false, 'full');
     $http = eZHTTPTool::instance();
     $http->setSessionVariable('RedirectURIAfterPublish', $href);
     return eZWorkflowType::STATUS_ACCEPTED;
 }
开发者ID:netgen,项目名称:ngpush,代码行数:18,代码来源:ngpushredirecttype.php

示例8: fetchByListObjectVersion

 /**
  * Spezific function to fetch NL list
  * if it is an Virtual List return a CjwNewsletterListVirtual object
  * otherwise CjwNewsletterList
  *
  * @param int $listContentObjectId
  * @param int $listContentObjectVersion
  */
 static function fetchByListObjectVersion($listContentObjectId, $listContentObjectVersion)
 {
     if ((int) $listContentObjectVersion == 0) {
         $listContentObject = eZContentObject::fetch($listContentObjectId, true);
         if (!is_object($listContentObject)) {
             return false;
         }
         $listContentObjectVersion = $listContentObject->attribute('current');
     } else {
         $listContentObjectVersion = eZContentObjectVersion::fetchVersion($listContentObjectVersion, $listContentObjectId);
     }
     if (is_object($listContentObjectVersion)) {
         $dataMap = $listContentObjectVersion->attribute('data_map');
         if (isset($dataMap['newsletter_list'])) {
             $newsletterListAttribute = $dataMap['newsletter_list'];
             $newsletterListAttributeContent = $newsletterListAttribute->attribute('content');
             return $newsletterListAttributeContent;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:hudri,项目名称:cjw_newsletter,代码行数:32,代码来源:cjwnewsletterlist.php

示例9: array

//
// The "eZ publish professional licence" version 2 is available at
// http://ez.no/ez_publish/licences/professional/ and in the file
// PROFESSIONAL_LICENCE included in the packaging of this file.
// For pricing of this licence please contact us via e-mail to licence@ez.no.
// Further contact information is available at http://ez.no/company/contact/.
//
// The "GNU General Public License" (GPL) is available at
// http://www.gnu.org/copyleft/gpl.html.
//
// Contact licence@ez.no if any conditions of this licencing isn't clear to
// you.
//
$ObjectID = $Params['ObjectID'];
$ObjectVersion = $Params['ObjectVersion'];
$object = eZContentObjectVersion::fetchVersion($ObjectVersion, $ObjectID);
$newsletter = eZNewsletter::fetchByContentObject($ObjectID, $ObjectVersion, false, true);
$tpl = eZNewsletterTemplateWrapper::templateInit();
$tpl->setVariable('object', $object);
$tpl->setVariable('contentobject', $object);
$tpl->setVariable('newsletter', $newsletter);
if (!$newsletter) {
    return false;
}
//skin selection
$skin_prefix = 'eznewsletter';
$custom_skin = $newsletter->attribute('design_to_use');
$Result = array();
if ($custom_skin) {
    $skin_prefix = $custom_skin;
}
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:previewfull.php

示例10: removeRelationObject

 static function removeRelationObject($contentObjectAttribute, $deletionItem)
 {
     if (self::isItemPublished($deletionItem)) {
         return;
     }
     $hostObject = $contentObjectAttribute->attribute('object');
     $hostObjectID = $hostObject->attribute('id');
     // Do not try removing the object if present in trash
     // Only objects being really orphaned (not even being in trash) should be removed by this method.
     // See issue #019457
     if ((int) eZPersistentObject::count(eZContentObjectTrashNode::definition(), array("contentobject_id" => $hostObjectID)) > 0) {
         return;
     }
     $hostObjectVersions = $hostObject->versions();
     $isDeletionAllowed = true;
     // check if the relation item to be deleted is unique in the domain of all host-object versions
     foreach ($hostObjectVersions as $version) {
         if ($isDeletionAllowed and $version->attribute('version') != $contentObjectAttribute->attribute('version')) {
             $relationAttribute = eZPersistentObject::fetchObjectList(eZContentObjectAttribute::definition(), null, array('version' => $version->attribute('version'), 'contentobject_id' => $hostObjectID, 'contentclassattribute_id' => $contentObjectAttribute->attribute('contentclassattribute_id')));
             if (count($relationAttribute) > 0) {
                 $relationContent = $relationAttribute[0]->content();
                 if (is_array($relationContent) and is_array($relationContent['relation_list'])) {
                     foreach ($relationContent['relation_list'] as $relationItem) {
                         if ($deletionItem['contentobject_id'] == $relationItem['contentobject_id'] && $deletionItem['contentobject_version'] == $relationItem['contentobject_version']) {
                             $isDeletionAllowed = false;
                             break 2;
                         }
                     }
                 }
             }
         }
     }
     if ($isDeletionAllowed) {
         $subObjectVersion = eZContentObjectVersion::fetchVersion($deletionItem['contentobject_version'], $deletionItem['contentobject_id']);
         if ($subObjectVersion instanceof eZContentObjectVersion) {
             $subObjectVersion->removeThis();
         } else {
             eZDebug::writeError('Cleanup of subobject-version failed. Could not fetch object from relation list.\\n' . 'Requested subobject id: ' . $deletionItem['contentobject_id'] . '\\n' . 'Requested Subobject version: ' . $deletionItem['contentobject_version'], __METHOD__);
         }
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:41,代码来源:ezobjectrelationlisttype.php

示例11: contentObjectVersionObject

 /**
  * Returns the eZContentObjectVersionObject of the current node
  *
  * @param bool $asObject
  * @return eZContentObjectVersion|array|bool
  */
 function contentObjectVersionObject($asObject = true)
 {
     $version = eZContentObjectVersion::fetchVersion($this->ContentObjectVersion, $this->ContentObjectID, $asObject);
     if ($this->CurrentLanguage != false) {
         $version->CurrentLanguage = $this->CurrentLanguage;
     }
     return $version;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:14,代码来源:ezcontentobjecttreenode.php

示例12: templateInit

if ($options['current_hostname']) {
    $currentHostName = $options['current_hostname'];
}
if ($options['www_dir']) {
    $wwwDir = $options['www_dir'];
}
if ($options['skin_name']) {
    $skinName = $options['skin_name'];
}
//$iniName = $options['arguments'][0];
$ini = eZINI::instance('site.ini');
$siteUrl = $ini->variable('SiteSettings', 'SiteURL');
$locale = $ini->variable('RegionalSettings', 'Locale');
$outputContent = '';
// fetch objectversion
$contentObject = eZContentObjectVersion::fetchVersion($objectVersion, $objectId);
$tpl = templateInit();
$tpl->setVariable('contentobject', $contentObject);
if (!is_object($contentObject)) {
    $script->shutdown();
}
$contentType = 'text/html';
$newsletterEditionContent = array('html' => '', 'text' => '');
$htmlMailImageInclude = 0;
$urlArray = getUrlArray($siteUrl, $currentHostName, $wwwDir);
switch ($outputFormatId) {
    default:
        // html 0
    // html 0
    case CjwNewsletterSubscription::OUTPUT_FORMAT_HTML:
        // textpart
开发者ID:heliopsis,项目名称:cjw_newsletter,代码行数:31,代码来源:createoutput.php

示例13: testEditAfterFetchTemplateRepeatOperation

 /**
  * Test regression for issue #14371 in a module/view context:
  * Workflow template repeat broken by security patch.
  *
  * Test Outline
  * ------------
  * 1. Setup a workflow that features a custom workflow event that expects a
  *    value to be submitted before
  * 2. Create & publish an article
  * 3. Add a global POST variable that would be sent interactively from POST
  * 4. Publish again with this variable
  *
  * @result: Redirection to content/history
  * @expected: The object gets published without being redirected
  * @link http://issues.ez.no/14371
  */
 public function testEditAfterFetchTemplateRepeatOperation()
 {
     // first, we need to create an appropriate test workflow
     $adminUser = eZUser::fetchByName('admin');
     $adminUserID = $adminUser->attribute('contentobject_id');
     // Create approval workflow and set up pre publish trigger
     $this->workflow = $this->createWorkFlow($adminUserID);
     $this->trigger = $this->createTrigger($this->workflow->attribute('id'));
     // Log in as a user who's allowed to publish content
     $this->currentUser = eZUser::currentUser();
     eZUser::setCurrentlyLoggedInUser($adminUser, $adminUserID);
     // required to avoid a notice
     $GLOBALS['eZSiteBasics']['user-object-required'] = false;
     $contentModule = eZModule::findModule('content');
     $adminUserID = eZUser::fetchByName('admin')->attribute('contentobject_id');
     // STEP 1: Create an article
     // This should start the publishing process, and interrupt it because
     // of the fetch template repeat workflow (expected)
     $article = new ezpObject("article", 2, $adminUserID);
     $article->name = "Article (with interactive workflow) for issue/regression #14371";
     $objectID = $article->publish();
     $version = eZContentObjectVersion::fetchVersion(1, $objectID);
     // STEP 2: Add the POST variables that will allow the operation to continue
     $_POST['CompletePublishing'] = 1;
     // STEP 3: run content/edit again in order to simulate a POST from the custom TPL
     $operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $objectID, 'version' => 1));
     $this->assertInternalType('array', $operationResult);
     $this->assertEquals($operationResult['status'], eZModuleOperationInfo::STATUS_CONTINUE, "The operation result wasn't CONTINUE");
     $this->removeWorkflow($this->workflow);
     // Log in as whoever was logged in
     eZUser::setCurrentlyLoggedInUser($this->currentUser, $this->currentUser->attribute('id'));
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:48,代码来源:ezworkflowevent_regression.php

示例14: sendToPublishingQueue

 /**
  * Sends the published object/version for publishing to the queue
  * Used by the content/publish operation
  * @param int $objectId
  * @param int $version
  *
  * @return array( status => int )
  * @since 4.5
  */
 public static function sendToPublishingQueue($objectId, $version)
 {
     $behaviour = ezpContentPublishingBehaviour::getBehaviour();
     if ($behaviour->disableAsynchronousPublishing) {
         $asyncEnabled = false;
     } else {
         $asyncEnabled = eZINI::instance('content.ini')->variable('PublishingSettings', 'AsynchronousPublishing') == 'enabled';
     }
     $accepted = true;
     if ($asyncEnabled === true) {
         // Filter handlers
         $ini = eZINI::instance('content.ini');
         $filterHandlerClasses = $ini->variable('PublishingSettings', 'AsynchronousPublishingFilters');
         if (count($filterHandlerClasses)) {
             $versionObject = eZContentObjectVersion::fetchVersion($version, $objectId);
             foreach ($filterHandlerClasses as $filterHandlerClass) {
                 if (!class_exists($filterHandlerClass)) {
                     eZDebug::writeError("Unknown asynchronous publishing filter handler class '{$filterHandlerClass}'", __METHOD__);
                     continue;
                 }
                 $handler = new $filterHandlerClass($versionObject);
                 if (!$handler instanceof ezpAsynchronousPublishingFilterInterface) {
                     eZDebug::writeError("Asynchronous publishing filter handler class '{$filterHandlerClass}' does not implement ezpAsynchronousPublishingFilterInterface", __METHOD__);
                     continue;
                 }
                 $accepted = $handler->accept();
                 if (!$accepted) {
                     eZDebugSetting::writeDebug("Object #{$objectId}/{$version} was excluded from asynchronous publishing by {$filterHandlerClass}", __METHOD__);
                     break;
                 }
             }
         }
         unset($filterHandlerClasses, $handler);
     }
     if ($asyncEnabled && $accepted) {
         // if the object is already in the process queue, we move ahead
         // this test should NOT be necessary since http://issues.ez.no/17840 was fixed
         if (ezpContentPublishingQueue::isQueued($objectId, $version)) {
             return array('status' => eZModuleOperationInfo::STATUS_CONTINUE);
         } else {
             ezpContentPublishingQueue::add($objectId, $version);
             return array('status' => eZModuleOperationInfo::STATUS_HALTED, 'redirect_url' => "content/queued/{$objectId}/{$version}");
         }
     } else {
         return array('status' => eZModuleOperationInfo::STATUS_CONTINUE);
     }
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:56,代码来源:ezcontentoperationcollection.php

示例15: eventContent

 function eventContent($event)
 {
     return eZContentObjectVersion::fetchVersion($event->attribute('data_int2'), $event->attribute('data_int1'));
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:4,代码来源:ezpublishtype.php


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