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


PHP SugarBean::getIndices方法代码示例

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


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

示例1: _getIndexVardefs

 /**
  * Returns an array of indices for the current module
  *
  * @return array
  */
 private function _getIndexVardefs()
 {
     $indexes = $this->_focus->getIndices();
     //grab any custom indexes if they exist
     if ($this->_focus->hasCustomFields()) {
         $custmIndexes = $this->_focus->db->helper->get_indices($this->_focus->table_name . '_cstm');
         $indexes = array_merge($custmIndexes, $indexes);
     }
     // remove any that are datetime or time field as we can't dupe check them correctly since we don't export
     // seconds
     $fields = $this->_focus->getFieldDefinitions();
     foreach ($indexes as $key => $index) {
         foreach ($index['fields'] as $field) {
             if (isset($fields[$field]) && ($fields[$field]['type'] == 'datetime' || $fields[$field]['type'] == 'datetimecombo' || $fields[$field]['type'] == 'time')) {
                 unset($indexes[$key]);
                 break 1;
             }
         }
     }
     if ($this->_focus->getFieldDefinition('email1')) {
         $indexes[] = array('name' => 'special_idx_email1', 'type' => 'index', 'fields' => array('email1'));
     }
     if ($this->_focus->getFieldDefinition('email2')) {
         $indexes[] = array('name' => 'special_idx_email2', 'type' => 'index', 'fields' => array('email2'));
     }
     return $indexes;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:32,代码来源:ImportDuplicateCheck.php

示例2: createTableSQL

 /**
  * Generates sql for create table statement for a bean.
  *
  * @param  object $bean SugarBean instance
  * @return string SQL Create Table statement
  */
 public function createTableSQL(SugarBean $bean)
 {
     $tablename = $bean->getTableName();
     $fieldDefs = $bean->getFieldDefinitions();
     $indices = $bean->getIndices();
     return $this->createTableSQLParams($tablename, $fieldDefs, $indices);
 }
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:13,代码来源:DBHelper.php

示例3: repairTable

 /**
  * Implements repair of a db table for a bean.
  *
  * @param  object $bean    SugarBean instance
  * @param  bool   $execute true if we want the action to take place, false if we just want the sql returned
  * @return string SQL statement or empty string, depending upon $execute
  */
 public function repairTable(SugarBean $bean, $execute = true)
 {
     $indices = $bean->getIndices();
     $fielddefs = $bean->getFieldDefinitions();
     $tablename = $bean->getTableName();
     //Clean the indicies to prevent duplicate definitions
     $new_Indecies = array();
     foreach ($indices as $ind_def) {
         $new_Indecies[$ind_def['name']] = $ind_def;
     }
     //jc: added this for beans that do not actually have a table, namely
     //ForecastOpportunities
     if ($tablename == 'does_not_exist' || $tablename == '') {
         return '';
     }
     global $dictionary;
     $engine = null;
     if (isset($dictionary[$bean->getObjectName()]['engine']) && !empty($dictionary[$bean->getObjectName()]['engine'])) {
         $engine = $dictionary[$bean->getObjectName()]['engine'];
     }
     return $this->repairTableParams($tablename, $fielddefs, $new_Indecies, $execute, $engine);
 }
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:29,代码来源:DBManager.php

示例4: repairTable

 /**
  * Implements repair of a db table for a bean.
  *
  * @param  object $bean    SugarBean instance
  * @param  bool   $execute true if we want the action to take place, false if we just want the sql returned
  * @return string SQL statement or empty string, depending upon $execute
  */
 public function repairTable(SugarBean $bean, $execute = true)
 {
     $indices = $bean->getIndices();
     $fielddefs = $bean->getFieldDefinitions();
     $tablename = $bean->getTableName();
     //jc: added this for beans that do not actually have a table, namely
     //ForecastOpportunities
     if ($tablename == 'does_not_exist' || $tablename == '') {
         return '';
     }
     global $dictionary;
     $engine = null;
     if (isset($dictionary[$bean->getObjectName()]['engine']) && !empty($dictionary[$bean->getObjectName()]['engine'])) {
         $engine = $dictionary[$bean->getObjectName()]['engine'];
     }
     return $this->repairTableParams($tablename, $fielddefs, $indices, $execute, $engine);
 }
开发者ID:congtt,项目名称:pj.ntk,代码行数:24,代码来源:DBManager.php


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