当前位置: 首页>>代码示例>>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;未经允许,请勿转载。