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


PHP eZContentObjectVersion::fetchForUser方法代码示例

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


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

示例1: foreach

        foreach ( $deleteIDArray as $deleteID )
        {
            $version = eZContentObjectVersion::fetch( $deleteID );
            if ( $version instanceof eZContentObjectVersion )
            {
                eZDebug::writeNotice( $deleteID, "deleteID" );
                $version->removeThis();
            }
        }
        $db->commit();
    }
}

if ( $http->hasPostVariable( 'EmptyButton' )  )
{
    $versions = eZContentObjectVersion::fetchForUser( $userID );
    $db = eZDB::instance();
    $db->begin();
    foreach ( $versions as $version )
    {
        $version->removeThis();
    }
    $db->commit();
}

$tpl = eZTemplate::factory();

$tpl->setVariable('view_parameters', $viewParameters );

$Result = array();
$Result['content'] = $tpl->fetch( 'design:content/draft.tpl' );
开发者ID:nottavi,项目名称:ezpublish,代码行数:31,代码来源:draft.php

示例2: cleanupAllInternalDrafts

    /**
     * Removes all old internal drafts by the specified user for the past time span given by $timeDuration
     *
     * @param int|bool $userID The ID of the user to cleanup for, if false it will use the current user.
     * @param int $timeDuration default time duration for internal drafts 60*60*24 seconds (1 day)
     */
    static function cleanupAllInternalDrafts( $userID = false, $timeDuration = 86400 ) //
    {
        if ( !is_numeric( $timeDuration ) ||
             $timeDuration < 0 )
        {
            eZDebug::writeError( "The time duration must be a positive numeric value (timeDuration = $timeDuration)", __METHOD__ );
            return;
        }


        if ( $userID === false )
        {
            $userID = eZUser::currentUserID();
        }
        // Remove all internal drafts
        $untouchedDrafts = eZContentObjectVersion::fetchForUser( $userID, eZContentObjectVersion::STATUS_INTERNAL_DRAFT );

        $expiryTime = time() - $timeDuration; // only remove drafts older than time duration (default is 1 day)
        foreach ( $untouchedDrafts as $untouchedDraft )
        {
            if ( $untouchedDraft->attribute( 'modified' ) < $expiryTime )
            {
                $untouchedDraft->removeThis();
            }
        }
    }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:32,代码来源:ezcontentobject.php


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