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


PHP SugarBean::removeRelationshipMeta方法代码示例

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


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

示例1: remove_relationship_meta

 /**
  * This method has been deprecated.
  *
  * @see removeRelationshipMeta()
  * @deprecated 4.5.1 - Nov 14, 2006
  * @static
  */
 function remove_relationship_meta($key, $db, $log, $tablename, $dictionary, $module_dir)
 {
     SugarBean::removeRelationshipMeta($key, $db, $tablename, $dictionary, $module_dir);
 }
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:11,代码来源:SugarBean.php

示例2: uninstall_relationship

 function uninstall_relationship($file, $rel_dictionary = null)
 {
     if ($rel_dictionary == null) {
         if (!file_exists($file)) {
             $GLOBALS['log']->debug('File does not exists : ' . $file);
             return;
         }
         include $file;
         $rel_dictionary = $dictionary;
     }
     foreach ($rel_dictionary as $rel_name => $rel_data) {
         if (!empty($rel_data['table'])) {
             $table = $rel_data['table'];
         } else {
             $table = ' One-to-Many ';
         }
         if ($this->db->tableExists($table) && isset($GLOBALS['mi_remove_tables']) && $GLOBALS['mi_remove_tables']) {
             SugarBean::removeRelationshipMeta($rel_name, $this->db, $table, $rel_dictionary, '');
             $this->db->dropTableName($table);
             if (!$this->silent) {
                 $this->log(translate('LBL_MI_UN_RELATIONSHIPS_DROP') . $table);
             }
         }
         //Delete Layout defs
         // check to see if we have any vardef or layoutdef entries to remove - must have a relationship['module'] parameter if we do
         if (!isset($rel_data['module'])) {
             $mods = array($rel_data['relationships'][$rel_name]['lhs_module'], $rel_data['relationships'][$rel_name]['rhs_module']);
         } else {
             $mods = array($rel_data['module']);
         }
         $filename = "{$rel_name}.php";
         foreach ($mods as $mod) {
             if ($mod != 'application') {
                 $basepath = "custom/Extension/modules/{$mod}/Ext/";
             } else {
                 $basepath = "custom/Extension/application/Ext/";
             }
             foreach (array($filename, "custom" . $filename, $rel_name . "_" . $mod . ".php") as $fn) {
                 //remove any vardefs
                 $path = $basepath . "Vardefs/{$fn}";
                 if (file_exists($path)) {
                     rmdir_recursive($path);
                 }
                 //remove any layoutdefs
                 $path = $basepath . "Layoutdefs/{$fn}";
                 if (file_exists($path)) {
                     rmdir_recursive($path);
                 }
                 // Remove any wireless layoutdefs
                 $path = $basepath . "WirelessLayoutdefs/{$fn}";
                 if (file_exists($path)) {
                     rmdir_recursive($path);
                 }
             }
             // remove the subpanel layoutdefs for the relationship
             $subpanelFileNames = array("{$rel_name}_{$mod}.php", "_overridesubpanel-for-" . strtolower($mod) . "-{$rel_name}.php");
             foreach (glob("{$basepath}/clients/*", GLOB_NOSORT | GLOB_ONLYDIR) as $path) {
                 foreach (glob($path . "/layouts/subpanels/*.php", GLOB_NOSORT) as $file) {
                     $baseFile = basename($file);
                     if (in_array($baseFile, $subpanelFileNames)) {
                         unlink($file);
                     }
                 }
             }
             // Need to remove stale dashlets for the Activities relationship
             if (isset($rel_data['relationships'][$rel_name]) && file_exists('modules/' . $mod)) {
                 // Not our relationship
                 $ourRel = $rel_data['relationships'][$rel_name];
                 $globPath = 'modules/' . $mod . '/clients/base/views/*';
                 foreach (glob($globPath, GLOB_NOSORT | GLOB_ONLYDIR) as $viewPath) {
                     $platform = 'base';
                     $view = basename($viewPath);
                     if ($view != 'history' && $view != 'attachments' && $view != 'planned-activities') {
                         continue;
                     }
                     $viewMetaFile = $viewPath . "/" . $view . ".php";
                     if (!file_exists($viewMetaFile)) {
                         continue;
                     }
                     include $viewMetaFile;
                     if (!isset($viewdefs[$ourRel['lhs_module']][$platform]['view'][$view]['tabs'][0]['link'])) {
                         continue;
                     }
                     foreach ($viewdefs[$ourRel['lhs_module']][$platform]['view'][$view]['tabs'] as $viewTab) {
                         if ($viewTab['link'] == $rel_name) {
                             rmdir_recursive(dirname($viewPath));
                         }
                     }
                 }
             }
             // Remove relationship metadata
             $basepath = "custom/Extension/modules/relationships/*/";
             foreach (array($rel_name . "_" . $mod . ".php", $rel_name . "MetaData.php") as $fileName) {
                 foreach (glob($basepath . $fileName, GLOB_NOSORT) as $file) {
                     unlink($file);
                 }
             }
         }
         foreach (array($filename, "custom" . $filename, $rel_name . "_" . $mod . ".php") as $fn) {
             // remove the table dictionary extension
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:ModuleInstaller.php

示例3: uninstall_relationship

 function uninstall_relationship($file, $rel_dictionary = null)
 {
     if ($rel_dictionary == null) {
         if (!file_exists($file)) {
             $GLOBALS['log']->debug('File does not exists : ' . $file);
             return;
         }
         include $file;
         $rel_dictionary = $dictionary;
     }
     foreach ($rel_dictionary as $rel_name => $rel_data) {
         if (!empty($rel_data['table'])) {
             $table = $rel_data['table'];
         } else {
             $table = ' One-to-Many ';
         }
         if ($this->db->tableExists($table) && isset($GLOBALS['mi_remove_tables']) && $GLOBALS['mi_remove_tables']) {
             SugarBean::removeRelationshipMeta($rel_name, $this->db, $table, $rel_dictionary, '');
             $this->db->dropTableName($table);
             if (!$this->silent) {
                 $this->log(translate('LBL_MI_UN_RELATIONSHIPS_DROP') . $table);
             }
         }
         //Delete Layout defs
         // check to see if we have any vardef or layoutdef entries to remove - must have a relationship['module'] parameter if we do
         if (!isset($rel_data['module'])) {
             $mods = array($rel_data['relationships'][$rel_name]['lhs_module'], $rel_data['relationships'][$rel_name]['rhs_module']);
         } else {
             $mods = array($rel_data['module']);
         }
         $filename = "{$rel_name}.php";
         foreach ($mods as $mod) {
             if ($mod != 'application') {
                 $basepath = "custom/Extension/modules/{$mod}/Ext/";
             } else {
                 $basepath = "custom/Extension/application/Ext/";
             }
             foreach (array($filename, "custom" . $filename, $rel_name . "_" . $mod . ".php") as $fn) {
                 //remove any vardefs
                 $path = $basepath . "Vardefs/{$fn}";
                 if (file_exists($path)) {
                     rmdir_recursive($path);
                 }
                 //remove any layoutdefs
                 $path = $basepath . "Layoutdefs/{$fn}";
                 if (file_exists($path)) {
                     rmdir_recursive($path);
                 }
                 $path = $basepath . "WirelessLayoutdefs/{$fn}";
                 if (file_exists($path)) {
                     rmdir_recursive($path);
                 }
             }
             $relationships_path = 'custom/Extension/modules/relationships/';
             $relationships_dirs = array('layoutdefs', 'vardefs', 'wirelesslayoutdefs');
             foreach ($relationships_dirs as $relationship_dir) {
                 $realtionship_file_path = $relationships_path . $relationship_dir . "/{$rel_name}_{$mod}.php";
                 if (file_exists($realtionship_file_path)) {
                     rmdir_recursive($realtionship_file_path);
                 }
             }
             if (file_exists($relationships_path . "relationships/{$rel_name}MetaData.php")) {
                 rmdir_recursive($relationships_path . "relationships/{$rel_name}MetaData.php");
             }
         }
         foreach (array($filename, "custom" . $filename, $rel_name . "_" . $mod . ".php") as $fn) {
             // remove the table dictionary extension
             if (file_exists("custom/Extension/application/Ext/TableDictionary/{$fn}")) {
                 unlink("custom/Extension/application/Ext/TableDictionary/{$fn}");
             }
             if (file_exists("custom/metadata/{$rel_name}MetaData.php")) {
                 unlink("custom/metadata/{$rel_name}MetaData.php");
             }
         }
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:76,代码来源:ModuleInstaller.php

示例4: uninstall_relationship

 function uninstall_relationship($file)
 {
     if (!file_exists($file)) {
         $GLOBALS['log']->debug('File does not exists : ' . $file);
         return;
     }
     include_once $file;
     $rel_dictionary = $dictionary;
     foreach ($rel_dictionary as $rel_name => $rel_data) {
         $table = $rel_data['table'];
         if ($this->db->tableExists($table)) {
             SugarBean::removeRelationshipMeta($rel_name, $this->db, $table, $rel_dictionary, '');
             $this->db->dropTableName($table);
             Relationship::delete_cache();
             if (!$this->silent) {
                 $GLOBALS['log']->debug('droping table ' . $table);
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:20,代码来源:ModuleInstaller.php


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