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


PHP eZContentCacheManager::generateObjectViewCache方法代碼示例

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


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

示例1: setSettings

   /**
     * Changes user settings
     *
     * @param int $userID
     * @param int $isEnabled
     * @param int $maxLogin
     *
     * @return array An array with operation status, always true if userID is ok
     */
    static public function setSettings( $userID, $isEnabled, $maxLogin )
    {
        $userSetting = eZUserSetting::fetch( $userID );

        if ( $userSetting )
        {
            $userSetting->setAttribute( 'max_login', $maxLogin );
            $isUserEnabled = $isEnabled != 0;

            if ( $userSetting->attribute( 'is_enabled' ) != $isUserEnabled )
            {
                eZContentCacheManager::clearContentCacheIfNeeded( $userID );
                eZContentCacheManager::generateObjectViewCache( $userID );
            }

            $userSetting->setAttribute( "is_enabled", $isUserEnabled );
            $userSetting->store();

            if ( !$isUserEnabled )
            {
                eZUser::removeSessionData( $userID );
            }
            else
            {
                eZUserAccountKey::removeByUserID( $userID );
            }
            return array( 'status' => true );
        }
        else
        {
            eZDebug::writeError( "Failed to change settings of user $userID ", __METHOD__ );
            return array( 'status' => false );
        }
    }
開發者ID:sushilbshinde,項目名稱:ezpublish-study,代碼行數:43,代碼來源:ezuseroperationcollection.php

示例2: generateObjectViewCache

 public static function generateObjectViewCache($objectID)
 {
     eZContentCacheManager::generateObjectViewCache($objectID);
 }
開發者ID:EVE-Corp-Center,項目名稱:ECC-Website,代碼行數:4,代碼來源:ezcontentoperationcollection.php

示例3: setFailedLoginAttempts

 static function setFailedLoginAttempts($userID, $value = false, $setByForce = false)
 {
     $trustedUser = eZUser::isTrusted();
     // If user is trusted we should stop processing
     if ($trustedUser and !$setByForce) {
         return true;
     }
     $maxNumberOfFailedLogin = eZUser::maxNumberOfFailedLogin();
     if ($maxNumberOfFailedLogin == '0' and !$setByForce) {
         return true;
     }
     $userID = (int) $userID;
     $userObject = eZUser::fetch($userID);
     if (!$userObject) {
         return true;
     }
     $isEnabled = $userObject->isEnabled();
     // If current user is disabled we should not continue
     if (!$isEnabled and !$setByForce) {
         return true;
     }
     $db = eZDB::instance();
     $db->begin();
     $userVisitArray = $db->arrayQuery("SELECT 1 FROM ezuservisit WHERE user_id={$userID}");
     if (isset($userVisitArray[0])) {
         if ($value === false) {
             $failedLoginAttempts = $userObject->failedLoginAttempts();
             $failedLoginAttempts += 1;
         } else {
             $failedLoginAttempts = (int) $value;
         }
         $db->query("UPDATE ezuservisit SET failed_login_attempts={$failedLoginAttempts} WHERE user_id={$userID}");
     } else {
         if ($value === false) {
             $failedLoginAttempts = 1;
         } else {
             $failedLoginAttempts = (int) $value;
         }
         $db->query("INSERT INTO ezuservisit ( failed_login_attempts, user_id ) VALUES ( {$failedLoginAttempts}, {$userID} )");
     }
     $db->commit();
     eZContentCacheManager::clearContentCacheIfNeeded($userID);
     eZContentCacheManager::generateObjectViewCache($userID);
 }
開發者ID:brookinsconsulting,項目名稱:ezecosystem,代碼行數:44,代碼來源:ezuser.php


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