本文整理匯總了PHP中eZContentObjectStateGroup::fetchByOffset方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObjectStateGroup::fetchByOffset方法的具體用法?PHP eZContentObjectStateGroup::fetchByOffset怎麽用?PHP eZContentObjectStateGroup::fetchByOffset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObjectStateGroup
的用法示例。
在下文中一共展示了eZContentObjectStateGroup::fetchByOffset方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: attribute
function attribute($attr)
{
switch ($attr) {
case 'state_group':
return eZContentObjectStateGroup::fetchByOffset();
default:
return eZWorkflowEventType::attribute($attr);
}
}
示例2: allowedAssignStateList
/**
* @param eZUser|null $user
* @return array
*/
function allowedAssignStateList( eZUser $user = null )
{
$allowedStateIDList = $this->allowedAssignStateIDList( $user );
// retrieve state groups, and for each state group the allowed states (including the current state)
$groups = eZContentObjectStateGroup::fetchByOffset( false, false );
$allowedAssignList = array();
foreach ( $groups as $group )
{
// we do not return any internal state
// all internal states are prepended with the string : "ez_"
if( strpos( $group->attribute( 'identifier' ), 'ez' ) === 0 )
continue;
$states = array();
$groupStates = $group->attribute( 'states' );
$currentStateIDArray = $this->attribute( 'state_id_array' );
$current = false;
foreach ( $groupStates as $groupState )
{
$stateID = $groupState->attribute( 'id' );
if ( in_array( $stateID, $allowedStateIDList ) )
{
$states[] = $groupState;
}
if ( in_array( $stateID, $currentStateIDArray ) )
{
$current = $groupState;
}
}
$allowedAssignList[] = array( 'group' => $group, 'states' => $states, 'current' => $current );
}
return $allowedAssignList;
}
示例3: array
);
$options = $script->getOptions( '', '', array( '-q' => 'Quiet mode' ) );
$cli = eZCLI::instance();
$script->initialize();
$script->startup();
$db = eZDB::instance();
$limit = 50;
$offset = 0;
while ( true )
{
$groups = eZContentObjectStateGroup::fetchByOffset( $limit, $offset );
if ( empty( $groups ) )
{
break;
}
foreach ( $groups as $group )
{
$cli->output( 'Fixing translations for group ' . $group->attribute( 'identifier' ), false );
$groupId = $group->attribute( 'id' );
$defaultLangId = $group->attribute( 'default_language_id' );
// for the default language id, the correct record is the one with
// the always available bit, so we delete records without it
// ie language_id = real_language_id = $defaultLangId
$queryDefaultLang = "DELETE FROM ezcobj_state_group_language
WHERE contentobject_state_group_id={$groupId}