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


PHP Vtiger_Field::getAllForModule方法代碼示例

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


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

示例1: getFields

 /**
  * Get all the fields of the module or block
  * @param Vtiger_Block Instance of block to use to get fields, false to get all the block fields
  */
 function getFields($blockInstance = false)
 {
     $fields = false;
     if ($blockInstance) {
         $fields = Vtiger_Field::getAllForBlock($blockInstance, $this);
     } else {
         $fields = Vtiger_Field::getAllForModule($this);
     }
     return $fields;
 }
開發者ID:cin-system,項目名稱:cinrepo,代碼行數:14,代碼來源:ModuleBasic.php

示例2: update_Fields

 /**
  * Update Fields of the module
  * @access private
  */
 function update_Fields($blocknode, $blockInstance, $moduleInstance)
 {
     if (empty($blocknode->fields) || empty($blocknode->fields->field)) {
         return;
     }
     foreach ($blocknode->fields->field as $fieldnode) {
         $this->listFields[] = strval($fieldnode->fieldname);
         $fieldInstance = Vtiger_Field::getInstance((string) $fieldnode->fieldname, $moduleInstance);
         if (!$fieldInstance) {
             $fieldInstance = $this->import_Field($blocknode, $blockInstance, $moduleInstance, $fieldnode);
         } else {
             $this->update_Field($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance);
         }
         $this->__AddModuleFieldToCache($moduleInstance, $fieldInstance->name, $fieldInstance);
     }
     // Deleting removed fields
     $listFieldBeforeUpdate = Vtiger_Field::getAllForModule($moduleInstance);
     foreach ($listFieldBeforeUpdate as $fieldInstance) {
         if (!in_array($fieldInstance->name, $this->listFields)) {
             $fieldInstance->delete();
         }
     }
 }
開發者ID:rcrrich,項目名稱:UpdatePackages,代碼行數:27,代碼來源:PackageUpdate.php

示例3: getAllForModule

 /**
  * Function to retrieve field model for specific block and module
  * @param <Vtiger_Module_Model> $blockModel - block instance
  * @return <array> List of field model
  */
 public static function getAllForModule($moduleModel)
 {
     $fieldModelList = Vtiger_Cache::get('ModuleFields', $moduleModel->id);
     if (!$fieldModelList) {
         $fieldObjects = parent::getAllForModule($moduleModel);
         $fieldModelList = array();
         //if module dont have any fields
         if (!is_array($fieldObjects)) {
             $fieldObjects = array();
         }
         foreach ($fieldObjects as $fieldObject) {
             $fieldModelObject = self::getInstanceFromFieldObject($fieldObject);
             $fieldModelList[$fieldModelObject->get('block')->id][] = $fieldModelObject;
             Vtiger_Cache::set('field-' . $moduleModel->getId(), $fieldModelObject->getId(), $fieldModelObject);
             Vtiger_Cache::set('field-' . $moduleModel->getId(), $fieldModelObject->getName(), $fieldModelObject);
         }
         Vtiger_Cache::set('ModuleFields', $moduleModel->id, $fieldModelList);
     }
     return $fieldModelList;
 }
開發者ID:noclav,項目名稱:UpdatePackages,代碼行數:25,代碼來源:Field.php

示例4: update_Blocks

 /**
  * Update Blocks of the module
  * @access private
  */
 function update_Blocks($modulenode, $moduleInstance)
 {
     if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
         return;
     }
     foreach ($modulenode->blocks->block as $blocknode) {
         $this->listBlocks[] = strval($blocknode->label);
         $blockInstance = Vtiger_Block::getInstance((string) $blocknode->label, $moduleInstance);
         if (!$blockInstance) {
             $blockInstance = $this->import_Block($modulenode, $moduleInstance, $blocknode);
         } else {
             $this->update_Block($modulenode, $moduleInstance, $blocknode, $blockInstance);
         }
         $this->update_Fields($blocknode, $blockInstance, $moduleInstance);
     }
     // Deleting removed fields
     $listFieldBeforeUpdate = Vtiger_Field::getAllForModule($moduleInstance);
     foreach ($listFieldBeforeUpdate as $fieldInstance) {
         if (!in_array($fieldInstance->name, $this->listFields)) {
             $fieldInstance->delete();
         }
     }
     // Deleting removed blocks
     $listBlockBeforeUpdate = Vtiger_Block::getAllForModule($moduleInstance);
     foreach ($listBlockBeforeUpdate as $blockInstance) {
         if (!in_array($blockInstance->label, $this->listBlocks)) {
             $blockInstance->delete();
         }
     }
 }
開發者ID:rossman22590,項目名稱:VTModuleDesigner,代碼行數:34,代碼來源:PackageUpdate.php


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