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


PHP DBManager::getValidDBName方法代码示例

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


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

示例1: loadBeans

 /**
  * Load Beans uses Link2 to take a SugarQuery object and add the joins needed to take a link and make the connection
  *
  * @param Linkname $join
  * @param $alias
  */
 protected function loadBeans($join, $options)
 {
     $alias = !empty($options['alias']) ? $options['alias'] : $this->getJoinTableAlias($join);
     $joinType = !empty($options['joinType']) ? $options['joinType'] : 'INNER';
     $team_security = isset($options['team_security']) ? $options['team_security'] : true;
     $ignoreRole = !empty($options['ignoreRole']) ? $options['ignoreRole'] : false;
     $bean = !empty($options['relatedJoin']) ? $this->join[$options['relatedJoin']]->bean : $this->from;
     if (is_array($bean)) {
         // the bean is the first element of the array
         $bean = reset($bean);
     }
     $bean->load_relationship($join);
     if (empty($bean->{$join})) {
         throw new SugarApiExceptionInvalidParameter("Invalid link {$join}");
     }
     $bean->{$join}->buildJoinSugarQuery($this, array('joinTableAlias' => $alias, 'joinType' => $joinType, 'ignoreRole' => $ignoreRole));
     $joined = BeanFactory::newBean($bean->{$join}->getRelatedModuleName());
     if ($team_security === true) {
         $joined->addVisibilityQuery($this, array("table_alias" => $alias, 'as_condition' => true));
     }
     if ($joined->hasCustomFields()) {
         $table_cstm = $joined->get_custom_table_name();
         $alias_cstm = $this->db->getValidDBName($alias . '_cstm', false, 'alias');
         $this->joinTable($table_cstm, array('alias' => $alias_cstm, 'joinType' => "LEFT", "linkingTable" => true))->on()->equalsField("{$alias_cstm}.id_c", "{$alias}.id");
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:32,代码来源:SugarQuery.php

示例2: foreach

 /**
  * Construct where clause from a list of name-value pairs.
  * @param array $fields_array Name/value pairs for column checks
  * @return string The WHERE clause
  */
 function get_where($fields_array)
 {
     $where_clause = "";
     foreach ($fields_array as $name => $value) {
         if (!empty($where_clause)) {
             $where_clause .= " AND ";
         }
         $name = $this->db->getValidDBName($name);
         $where_clause .= "{$name} = " . $this->db->quoted($value, false);
     }
     if (!empty($where_clause)) {
         return "WHERE {$where_clause} AND deleted=0";
     } else {
         return "WHERE deleted=0";
     }
 }
开发者ID:nicolasbui,项目名称:sugarcrm_dev,代码行数:21,代码来源:SugarBean.php

示例3: getRelateAlias

 /**
  * Composes alias for related name field part
  *
  * @param string $field      Current bean field
  * @param string $name_field Related bean field
  *
  * @return string
  */
 public function getRelateAlias($field, $name_field)
 {
     $alias = sprintf('rel_%s_%s', $field, $name_field);
     $alias = $this->db->getValidDBName($alias, true, 'alias');
     return $alias;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:SugarBean.php


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