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


PHP eZContentClassClassGroup::removeGroup方法代碼示例

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


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

示例1: removeGroup

    static function removeGroup( $classID, $classVersion, $selectedGroup )
    {
        $class = eZContentClass::fetch( $classID, true, eZContentClass::VERSION_STATUS_DEFINED );
        if ( !$class )
            return false;
        $groups = $class->attribute( 'ingroup_list' );
        foreach ( array_keys( $groups ) as $key )
        {
            if ( in_array( $groups[$key]->attribute( 'group_id' ), $selectedGroup ) )
            {
                unset( $groups[$key] );
            }
        }

        if ( count( $groups ) == 0 )
        {
            return false;
        }
        else
        {
            foreach(  $selectedGroup as $group_id )
            {
                eZContentClassClassGroup::removeGroup( $classID, $classVersion, $group_id );
            }
        }
        return true;
    }
開發者ID:sushilbshinde,項目名稱:ezpublish-study,代碼行數:27,代碼來源:ezclassfunctions.php

示例2: removeFromGroup

 private function removeFromGroup($classIdentifier, $groupIdentifier)
 {
     $classObject = eZContentClass::fetchByIdentifier($classIdentifier);
     $groupObject = eZContentClassGroup::fetchByName($groupIdentifier);
     if (!$classObject) {
         throw new Exception("Invalid Class Identifier. [" . $classIdentifier . "]");
     }
     if (!$groupObject) {
         throw new Exception("Invalid Group Identifier. [" . $groupIdentifier . "]");
     }
     $db = eZDB::instance();
     $db->begin();
     eZContentClassClassGroup::removeGroup($classObject->ID, null, $groupObject->ID);
     $db->commit();
     echo "Successfully removed class [" . $classIdentifier . "] from group [" . $groupIdentifier . "]";
 }
開發者ID:truffo,項目名稱:eep,代碼行數:16,代碼來源:index.php

示例3: syncGroups

 protected function syncGroups()
 {
     $remote = $this->getRemote();
     if ($remote === null) {
         throw new Exception("Classe remota non trovata");
     }
     $this->syncAllGroups($remote);
     $locale = $this->currentClass;
     /** @var eZContentClassClassGroup[] $localGroups */
     $localGroups = $locale->fetchGroupList();
     //$localGroupsNames = array();
     //$remoteGroupsNames = array();
     foreach ($localGroups as $group) {
         /** @var eZContentClassGroup $classGroup */
         $classGroup = eZContentClassGroup::fetchByName($group->attribute('group_name'));
         if ($classGroup) {
             eZContentClassClassGroup::removeGroup($this->currentClass->attribute('id'), $this->currentClass->attribute('version'), $classGroup->attribute('id'));
         }
     }
     foreach ($remote->InGroups as $group) {
         /** @var eZContentClassGroup $classGroup */
         $classGroup = eZContentClassGroup::fetchByName($group->GroupName);
         if ($classGroup) {
             $ingroup = eZContentClassClassGroup::create($this->currentClass->attribute('id'), $this->currentClass->attribute('version'), $classGroup->attribute('id'), $classGroup->attribute('name'));
             $ingroup->store();
         }
     }
     //$groups = $this->currentClass->attribute( 'ingroup_list' );
     //if ( count( $groups ) == 0 )
     //{
     //    //@todo
     //}
 }
開發者ID:OpencontentCoop,項目名稱:ocsearchtools,代碼行數:33,代碼來源:occlasstools.php


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