我在哪里覆盖自定义模块的 create_export_query? [英] Where do I override the create_export_query for a custom module?

查看:27
本文介绍了我在哪里覆盖自定义模块的 create_export_query?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SugarCRM.

I am working with SugarCRM.

我有一个自定义模块,我试图覆盖导出方法以不包含所有列.我实际上需要使列依赖于列表视图中的可见列(我可以弄清楚).

I have a custom module, I am trying to override the export method to not include all of the columns. I actually need to make the columns dependent on the visible columns in the list view (that I can figure out).

我浏览了 SugarCRM 中的所有文件,我注意到内置模块有一个 Module.php 文件,其中有一个 'SELECT Module.*' 用于导出方法.我无法为我的自定义模块找到这样的文件.我正在寻求有关在哪里创建(如果需要)或在哪里可以找到自定义 create_export_query 的文件的帮助.

I have been going through all the files in SugarCRM, I notice that the built in modules have a Module.php file, where there is a 'SELECT Module.*' for the export method. I cannot find a file like that for my custom module. I am asking for help on where do I create (if needed) or where can I find the file to customize the create_export_query.

推荐答案

create_export_query 是 SugarBean 中的一个方法(/data/SugarBean.php 是近所有 SugarCRM 对象)并且可以在 bean 的核心类文件中被覆盖.因此,如果您有自定义模块 MyModule,您可以在 /modules/MyModule/MyModule.php

create_export_query is a method in SugarBean (/data/SugarBean.php is the base class for nearly all SugarCRM objects) and can be overriden in the bean's core class file. So if you have custom module MyModule you can find the core class in /modules/MyModule/MyModule.php

目前可能没有 create_export_query() 方法,所以你可以写一个.它看起来像这样:

There is likely not a create_export_query() method there currently, so you can write one in. It'll look something like this:

<?php
require_once("include/SugarObjects/templates/basic/Basic.php");
class MyModule extends Basic{

  public function MyModule(){
    parent::Basic();
  }

  public function create_export_query(&$order_by, &$where, $relate_link_join=''){
    $query = " select * from {$this->table_name} "; // build your query string however you like
    return $query;
  }
}

这篇关于我在哪里覆盖自定义模块的 create_export_query?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆