当前位置: 首页>>代码示例>>PHP>>正文


PHP eZContentClassClassGroup::create方法代码示例

本文整理汇总了PHP中eZContentClassClassGroup::create方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentClassClassGroup::create方法的具体用法?PHP eZContentClassClassGroup::create怎么用?PHP eZContentClassClassGroup::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZContentClassClassGroup的用法示例。


在下文中一共展示了eZContentClassClassGroup::create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addGroup

 static function addGroup( $classID, $classVersion, $selectedGroup )
 {
     list ( $groupID, $groupName ) = explode( '/', $selectedGroup );
     $ingroup = eZContentClassClassGroup::create( $classID, $classVersion, $groupID, $groupName );
     $ingroup->store();
     return true;
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:7,代码来源:ezclassfunctions.php

示例2: testContentClassStillInGroupAfterEdition

    /**
     * Test that saving a content class in DEFINED version status
     * correctly manipulate associated class groups
     *
     * @link http://issues.ez.no/16197
     */
    public function testContentClassStillInGroupAfterEdition()
    {
        $class = eZContentClass::fetch( $this->class->id );
        // This is logic contained in kernel/class/edit.php
        foreach ( eZContentClassClassGroup::fetchGroupList( $class->attribute( 'id' ),
                                                            eZContentClass::VERSION_STATUS_DEFINED )  as $classGroup )
        {
            eZContentClassClassGroup::create( $class->attribute( 'id' ),
                                              eZContentClass::VERSION_STATUS_TEMPORARY,
                                              $classGroup->attribute( 'group_id' ),
                                              $classGroup->attribute( 'group_name' ) )
                ->store();
        }

        $attributes = $class->fetchAttributes();
        $class->setAttribute( 'version', eZContentClass::VERSION_STATUS_TEMPORARY );
        $class->NameList->setHasDirtyData();

        foreach ( $attributes as $attribute )
        {
            $attribute->setAttribute( 'version', eZContentClass::VERSION_STATUS_TEMPORARY );
            if ( $dataType = $attribute->dataType() )
                $dataType->initializeClassAttribute( $attribute );
        }

        $class->store( $attributes );
        $db = eZDB::instance();
        $db->begin();
        $class->storeVersioned( $attributes, eZContentClass::VERSION_STATUS_DEFINED );
        $db->commit();

        $this->assertTrue( eZContentClassClassGroup::classInGroup( $class->attribute( 'id' ),
                                                                   eZContentClass::VERSION_STATUS_DEFINED,
                                                                   1 ) );
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:41,代码来源:ezcontentclass_regression.php

示例3: __construct

 /**
  * Initialize ezpClass object
  *
  * @param string $name
  * @param string $identifier
  * @param string $contentObjectName
  * @param int $creatorID
  * @param string $language
  * @param int $groupID
  * @param string $groupName
  */
 public function __construct($name = 'Test class', $identifier = 'test_class', $contentObjectName = '<test_attribute>', $creatorID = 14, $language = 'eng-GB', $groupID = 1, $groupName = 'Content')
 {
     if (eZContentLanguage::fetchByLocale($language) === false) {
         $topPriorityLanguage = eZContentLanguage::topPriorityLanguage();
         if ($topPriorityLanguage) {
             $language = $topPriorityLanguage->attribute('locale');
         }
     }
     $this->language = $language;
     $this->class = eZContentClass::create($creatorID, array(), $this->language);
     $this->class->setName($name, $this->language);
     $this->class->setAttribute('contentobject_name', $contentObjectName);
     $this->class->setAttribute('identifier', $identifier);
     $this->class->store();
     $languageID = eZContentLanguage::idByLocale($this->language);
     $this->class->setAlwaysAvailableLanguageID($languageID);
     $this->classGroup = eZContentClassClassGroup::create($this->id, $this->version, $groupID, $groupName);
     $this->classGroup->store();
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:30,代码来源:class.php

示例4: appendClass

 function appendClass($class, $version = false)
 {
     if ($class instanceof eZContentClass) {
         $classID = $class->attribute('id');
         $version = $class->attribute('version');
     } else {
         $classID = $class;
     }
     $classGroupLink = eZContentClassClassGroup::create($classID, $version, $this->attribute('id'), $this->attribute('name'));
     $classGroupLink->store();
     return $classGroupLink;
 }
开发者ID:legende91,项目名称:ez,代码行数:12,代码来源:ezcontentclassgroup.php

示例5: array

            eZDebug::writeError('Undefined default language', 'class/edit.php');
            $Module->setExitStatus(eZModule::STATUS_FAILED);
            return;
        }
    }
    if (is_numeric($GroupID) and is_string($GroupName) and $GroupName != '') {
        $user = eZUser::currentUser();
        $user_id = $user->attribute('contentobject_id');
        $class = eZContentClass::create($user_id, array(), $EditLanguage);
        $class->setName(ezpI18n::tr('kernel/class/edit', 'New Class'), $EditLanguage);
        $class->store();
        $editLanguageID = eZContentLanguage::idByLocale($EditLanguage);
        $class->setAlwaysAvailableLanguageID($editLanguageID);
        $ClassID = $class->attribute('id');
        $ClassVersion = $class->attribute('version');
        $ingroup = eZContentClassClassGroup::create($ClassID, $ClassVersion, $GroupID, $GroupName);
        $ingroup->store();
        $Module->redirectTo($Module->functionURI('edit') . '/' . $ClassID . '/(language)/' . $EditLanguage);
        return;
    } else {
        $errorResponseGroupName = $GroupName == '' ? '<Empty name>' : $GroupName;
        $errorResponseGroupID = !is_numeric($GroupID) ? '<Empty ID>' : $GroupID;
        eZDebug::writeError("Unknown class group: {$errorResponseGroupName} (ID: {$errorResponseGroupID})", 'Kernel - Class - Edit');
        $Module->setExitStatus(eZModule::STATUS_FAILED);
        return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
    }
}
$contentClassHasInput = true;
if ($http->hasPostVariable('ContentClassHasInput')) {
    $contentClassHasInput = $http->postVariable('ContentClassHasInput');
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:edit.php

示例6: createClass

 private function createClass($displayName, $classIdentifier, $groupIdentifier, $groupId)
 {
     $adminUserObject = eZUser::fetchByName("admin");
     $adminUserObject->loginCurrent();
     $adminUserId = $adminUserObject->attribute('contentobject_id');
     $language = eZContentLanguage::topPriorityLanguage();
     $editLanguage = $language->attribute('locale');
     $class = eZContentClass::create($adminUserId, array(), $editLanguage);
     // this is the display name, ez automatically creates the content-class-identifier from it
     $class->setName($displayName, $editLanguage);
     $class->setAttribute("identifier", $classIdentifier);
     // default naming for objects - content classes should update this value once they have attributes added
     $class->setAttribute('contentobject_name', 'eep-created-content-class');
     $class->store();
     $editLanguageID = eZContentLanguage::idByLocale($editLanguage);
     $class->setAlwaysAvailableLanguageID($editLanguageID);
     $ClassID = $class->attribute('id');
     $ClassVersion = $class->attribute('version');
     $ingroup = eZContentClassClassGroup::create($ClassID, $ClassVersion, $groupId, $groupIdentifier);
     $ingroup->store();
     // clean up the content class status
     $class->storeDefined(array());
     $adminUserObject->logoutCurrent();
 }
开发者ID:truffo,项目名称:eep,代码行数:24,代码来源:index.php

示例7: 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::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。