本文整理汇总了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 );
}
}
示例2: generateObjectViewCache
public static function generateObjectViewCache($objectID)
{
eZContentCacheManager::generateObjectViewCache($objectID);
}
示例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);
}