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


PHP eZContentClassAttribute::definition方法代碼示例

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


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

示例1: removeAttributes

 function removeAttributes($removeAttributes = false, $version = false)
 {
     if (is_array($removeAttributes)) {
         $db = eZDB::instance();
         $db->begin();
         foreach ($removeAttributes as $attribute) {
             $attribute->removeThis();
         }
         $db->commit();
     } else {
         $contentClassID = $this->ID;
         if ($version === false) {
             $version = $this->Version;
         }
         $classAttributes = $this->fetchAttributes();
         $db = eZDB::instance();
         $db->begin();
         foreach ($classAttributes as $classAttribute) {
             $dataType = $classAttribute->dataType();
             $dataType->deleteStoredClassAttribute($classAttribute, $version);
         }
         eZPersistentObject::removeObject(eZContentClassAttribute::definition(), array('contentclass_id' => $contentClassID, 'version' => $version));
         $db->commit();
     }
 }
開發者ID:nlenardou,項目名稱:ezpublish,代碼行數:25,代碼來源:ezcontentclass.php

示例2: move

 function move( $down, $params = null )
 {
     if ( is_array( $params ) )
     {
         $pos = $params['placement'];
         $cid = $params['contentclass_id'];
         $version = $params['version'];
     }
     else
     {
         $pos = $this->Position;
         $cid = $this->ContentClassID;
         $version = $this->Version;
     }
     eZPersistentObject::reorderObject( eZContentClassAttribute::definition(),
                                        array( 'placement' => $pos ),
                                        array( 'contentclass_id' => $cid,
                                               'version' => $version ),
                                        $down );
 }
開發者ID:nottavi,項目名稱:ezpublish,代碼行數:20,代碼來源:ezcontentclassattribute.php

示例3: getSubTreeLimitationsCount

 /**
  * Returns count of eZContentClassAttribute objects (represented as subtree limitation count)
  *
  * @return integer
  */
 function getSubTreeLimitationsCount()
 {
     if ($this->attribute('main_tag_id') == 0) {
         return eZPersistentObject::count(eZContentClassAttribute::definition(), array('data_type_string' => 'eztags', eZTagsType::SUBTREE_LIMIT_FIELD => $this->attribute('id'), 'version' => eZContentClass::VERSION_STATUS_DEFINED));
     } else {
         return 0;
     }
 }
開發者ID:jordanmanning,項目名稱:ezpublish,代碼行數:13,代碼來源:eztagsobject.php

示例4: foreach

                $attribute->setAttribute('category', $categoryArray[$attributeID]);
            }
        }
    }
}
// Fixup input
if ($requireFixup) {
    foreach ($attributes as $attribute) {
        $dataType = $attribute->dataType();
        $status = $dataType->fixupClassAttributeHTTPInput($http, 'ContentClass', $attribute);
    }
}
$cur_datatype = 'ezstring';
// Apply HTTP POST variables
if ($contentClassHasInput) {
    eZHTTPPersistence::fetch('ContentAttribute', eZContentClassAttribute::definition(), $attributes, $http, true, 'id');
    if ($http->hasPostVariable('ContentAttribute_name')) {
        $attributeNames = $http->postVariable('ContentAttribute_name');
        foreach ($attributes as $attribute) {
            $key = $attribute->attribute('id');
            if (isset($attributeNames[$key])) {
                $attribute->setName($attributeNames[$key], $EditLanguage);
            }
        }
    }
    if ($http->hasPostVariable('ContentAttribute_description')) {
        $attributeNames = $http->postVariable('ContentAttribute_description');
        foreach ($attributes as $attribute) {
            $key = $attribute->attribute('id');
            if (isset($attributeNames[$key])) {
                $attribute->setDescription($attributeNames[$key], $EditLanguage);
開發者ID:brookinsconsulting,項目名稱:ezecosystem,代碼行數:31,代碼來源:edit.php

示例5: removeAttributes

 function removeAttributes($removeAttributes = false, $version = false)
 {
     if (is_array($removeAttributes)) {
         $db = eZDB::instance();
         $db->begin();
         foreach ($removeAttributes as $attribute) {
             $attribute->removeThis();
         }
         $db->commit();
     } else {
         $contentClassID = $this->ID;
         if ($version === false) {
             $version = $this->Version;
         }
         $classAttributes = $this->fetchAttributes();
         $db = eZDB::instance();
         $db->begin();
         foreach ($classAttributes as $classAttribute) {
             $dataType = $classAttribute->dataType();
             if ($dataType === null) {
                 eZDebug::writeError("Skipping removal of class attribute for non-existent datatype " . $classAttribute->DataTypeString, __METHOD__);
                 continue;
             }
             $dataType->deleteStoredClassAttribute($classAttribute, $version);
         }
         eZPersistentObject::removeObject(eZContentClassAttribute::definition(), array('contentclass_id' => $contentClassID, 'version' => $version));
         $db->commit();
     }
 }
開發者ID:CG77,項目名稱:ezpublish-legacy,代碼行數:29,代碼來源:ezcontentclass.php


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