當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZContentObjectVersion::removeVersions方法代碼示例

本文整理匯總了PHP中eZContentObjectVersion::removeVersions方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObjectVersion::removeVersions方法的具體用法?PHP eZContentObjectVersion::removeVersions怎麽用?PHP eZContentObjectVersion::removeVersions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZContentObjectVersion的用法示例。


在下文中一共展示了eZContentObjectVersion::removeVersions方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

$ini = eZINI::instance('content.ini');
$internalDraftsCleanUpLimit = $ini->hasVariable('VersionManagement', 'InternalDraftsCleanUpLimit') ? $ini->variable('VersionManagement', 'InternalDraftsCleanUpLimit') : 0;
$durationSetting = $ini->hasVariable('VersionManagement', 'InternalDraftsDuration') ? $ini->variable('VersionManagement', 'InternalDraftsDuration') : array('hours' => 24);
// by default, only remove drafts older than 1 day
$isDurationSet = false;
$duration = 0;
if (is_array($durationSetting)) {
    if (isset($durationSetting['days']) and is_numeric($durationSetting['days'])) {
        $duration += $durationSetting['days'] * 60 * 60 * 24;
        $isDurationSet = true;
    }
    if (isset($durationSetting['hours']) and is_numeric($durationSetting['hours'])) {
        $duration += $durationSetting['hours'] * 60 * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['minutes']) and is_numeric($durationSetting['minutes'])) {
        $duration += $durationSetting['minutes'] * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['seconds']) and is_numeric($durationSetting['seconds'])) {
        $duration += $durationSetting['seconds'];
        $isDurationSet = true;
    }
}
if ($isDurationSet) {
    $expiryTime = time() - $duration;
    $processedCount = eZContentObjectVersion::removeVersions(eZContentObjectVersion::STATUS_INTERNAL_DRAFT, $internalDraftsCleanUpLimit, $expiryTime);
    $cli->output("Cleaned up " . $processedCount . " internal drafts");
} else {
    $cli->output("Lifetime is not set for internal drafts (see your ini-settings, content.ini, VersionManagement section).");
}
開發者ID:sushilbshinde,項目名稱:ezpublish-study,代碼行數:31,代碼來源:internal_drafts_cleanup.php

示例2: array

// Cleaning up usual drafts
$ini = eZINI::instance('content.ini');
$draftsCleanUpLimit = $ini->hasVariable('VersionManagement', 'DraftsCleanUpLimit') ? $ini->variable('VersionManagement', 'DraftsCleanUpLimit') : 0;
$durationSetting = $ini->hasVariable('VersionManagement', 'DraftsDuration') ? $ini->variable('VersionManagement', 'DraftsDuration') : array('days' => 90);
$isDurationSet = false;
$duration = 0;
if (is_array($durationSetting)) {
    if (isset($durationSetting['days']) and is_numeric($durationSetting['days'])) {
        $duration += $durationSetting['days'] * 60 * 60 * 24;
        $isDurationSet = true;
    }
    if (isset($durationSetting['hours']) and is_numeric($durationSetting['hours'])) {
        $duration += $durationSetting['hours'] * 60 * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['minutes']) and is_numeric($durationSetting['minutes'])) {
        $duration += $durationSetting['minutes'] * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['seconds']) and is_numeric($durationSetting['seconds'])) {
        $duration += $durationSetting['seconds'];
        $isDurationSet = true;
    }
}
if ($isDurationSet) {
    $expiryTime = time() - $duration;
    $processedCount = eZContentObjectVersion::removeVersions(eZContentObjectVersion::STATUS_DRAFT, $draftsCleanUpLimit, $expiryTime);
    $cli->output("Cleaned up " . $processedCount . " drafts");
} else {
    $cli->output("Lifetime is not set for user's drafts (see your ini-settings, content.ini, VersionManagement section).");
}
開發者ID:EVE-Corp-Center,項目名稱:ECC-Website,代碼行數:31,代碼來源:old_drafts_cleanup.php

示例3: removeVersions

 /**
  * @param int|bool $versionStatus
  * @deprecated This method is left here only for backward compatibility. Use eZContentObjectVersion::removeVersions() method instead.
  */
 static function removeVersions( $versionStatus = false )
 {
     eZContentObjectVersion::removeVersions( $versionStatus );
 }
開發者ID:ezsystemstraining,項目名稱:ez54training,代碼行數:8,代碼來源:ezcontentobject.php

示例4:

    if ($dbUser !== false) {
        $params['user'] = $dbUser;
        $params['password'] = '';
    }
    if ($dbPassword !== false) {
        $params['password'] = $dbPassword;
    }
    if ($dbName !== false) {
        $params['database'] = $dbName;
    }
    $db = eZDB::instance($dbImpl, $params, true);
    eZDB::setInstance($db);
}
$db->setIsSQLOutputEnabled($showSQL);
if ($flatten['contentobject']) {
    $cli->output("Removing non-published content object versions");
    eZContentObjectVersion::removeVersions();
}
if ($flatten['contentclass']) {
    $cli->output("Removing temporary content classes");
    eZContentClass::removeTemporary();
}
if ($flatten['workflow']) {
    $cli->output("Removing temporary workflows");
    eZWorkflow::removeTemporary();
}
if ($flatten['role']) {
    $cli->output("Removing temporary roles");
    eZRole::removeTemporary();
}
$script->shutdown();
開發者ID:nfrp,項目名稱:ezpublish,代碼行數:31,代碼來源:flatten.php


注:本文中的eZContentObjectVersion::removeVersions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。