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


PHP PMA_Util::getGISFunctions方法代码示例

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


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

示例1: testGetGISFunctions

 /**
  * Test for getGISFunctions
  *
  * @return void
  */
 public function testGetGISFunctions()
 {
     $funcs = PMA_Util::getGISFunctions();
     $this->assertArrayHasKey('Dimension', $funcs);
     $this->assertArrayHasKey('GeometryType', $funcs);
     $this->assertArrayHasKey('MBRDisjoint', $funcs);
 }
开发者ID:yonh,项目名称:php-mvc,代码行数:12,代码来源:PMA_Util_test.php

示例2: _getGeomFuncHtml

 /**
  * Generates HTML for a geometrical function column to be displayed in table
  * search selection form
  *
  * @param integer $column_index index of current column in $columnTypes array
  *
  * @return string the generated HTML
  */
 private function _getGeomFuncHtml($column_index)
 {
     $html_output = '';
     // return if geometrical column is not present
     if (!$this->_geomColumnFlag) {
         return $html_output;
     }
     /**
      * Displays 'Function' column if it is present
      */
     $html_output .= '<td>';
     $geom_types = PMA_Util::getGISDatatypes();
     // if a geometry column is present
     if (in_array($this->_columnTypes[$column_index], $geom_types)) {
         $html_output .= '<select class="geom_func" name="geom_func[' . $column_index . ']">';
         // get the relevant list of GIS functions
         $funcs = PMA_Util::getGISFunctions($this->_columnTypes[$column_index], true, true);
         /**
          * For each function in the list of functions,
          * add an option to select list
          */
         foreach ($funcs as $func_name => $func) {
             $name = isset($func['display']) ? $func['display'] : $func_name;
             $html_output .= '<option value="' . htmlspecialchars($name) . '">' . htmlspecialchars($name) . '</option>';
         }
         $html_output .= '</select>';
     } else {
         $html_output .= '&nbsp;';
     }
     $html_output .= '</td>';
     return $html_output;
 }
开发者ID:minggLu,项目名称:openemr,代码行数:40,代码来源:TableSearch.class.php

示例3: _getGeomWhereClause

 /**
  * Return the where clause for a geometrical column.
  *
  * @param mixed  $criteriaValues Search criteria input
  * @param string $names          Name of the column on which search is submitted
  * @param string $func_type      Search function/operator
  * @param string $types          Type of the field
  * @param bool   $geom_func      Whether geometry functions should be applied
  *
  * @return string part of where clause.
  */
 private function _getGeomWhereClause($criteriaValues, $names, $func_type, $types, $geom_func = null)
 {
     $geom_unary_functions = array('IsEmpty' => 1, 'IsSimple' => 1, 'IsRing' => 1, 'IsClosed' => 1);
     $where = '';
     // Get details about the geometry functions
     $geom_funcs = PMA_Util::getGISFunctions($types, true, false);
     // New output type is the output type of the function being applied
     $types = $geom_funcs[$geom_func]['type'];
     // If the function takes a single parameter
     if ($geom_funcs[$geom_func]['params'] == 1) {
         $backquoted_name = $geom_func . '(' . PMA_Util::backquote($names) . ')';
     } else {
         // If the function takes two parameters
         // create gis data from the criteria input
         $gis_data = PMA_Util::createGISData($criteriaValues);
         $where = $geom_func . '(' . PMA_Util::backquote($names) . ',' . $gis_data . ')';
         return $where;
     }
     // If the where clause is something like 'IsEmpty(`spatial_col_name`)'
     if (isset($geom_unary_functions[$geom_func]) && trim($criteriaValues) == '') {
         $where = $backquoted_name;
     } elseif (in_array($types, PMA_Util::getGISDatatypes()) && !empty($criteriaValues)) {
         // create gis data from the criteria input
         $gis_data = PMA_Util::createGISData($criteriaValues);
         $where = $backquoted_name . ' ' . $func_type . ' ' . $gis_data;
     }
     return $where;
 }
开发者ID:saisai,项目名称:phpmyadmin,代码行数:39,代码来源:TableSearch.class.php


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