本文整理匯總了PHP中eZContentObjectStateGroup::store方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObjectStateGroup::store方法的具體用法?PHP eZContentObjectStateGroup::store怎麽用?PHP eZContentObjectStateGroup::store使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObjectStateGroup
的用法示例。
在下文中一共展示了eZContentObjectStateGroup::store方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: eZContentObjectStateGroup
break;
}
}
// when none of the preferred locales are in use, then use the top priority language
if ($localeToUse === false) {
$prioritizedLanguage = eZContentLanguage::topPriorityLanguage();
$localeToUse = $prioritizedLanguage->attribute('locale');
}
$lockGroup = new eZContentObjectStateGroup(array('identifier' => 'ez_lock'));
$trans = $lockGroup->translationByLocale($localeToUse);
$trans->setAttribute('name', 'Lock');
$trans->setAttribute('description', 'Lock group');
$messages = array();
if ($lockGroup->isValid($messages)) {
$cli->output('storing state group ez_lock');
$lockGroup->store();
} else {
eZDebug::writeDebug($messages);
$db->rollback();
$script->shutdown(2);
}
$notLockedState = $lockGroup->newState('not_locked');
$trans = $notLockedState->translationByLocale($localeToUse);
$trans->setAttribute('name', 'Not locked');
$trans->setAttribute('description', 'Not locked state');
$messages = array();
if ($notLockedState->isValid($messages)) {
$cli->output('storing state ez_lock/not_locked');
$notLockedState->store();
} else {
eZDebug::writeDebug($messages);