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


PHP AbstractSchemaManager::_getPortableTableIndexesList方法代码示例

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


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

示例1: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  */
 protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null)
 {
     foreach ($tableIndexRows as &$tableIndex) {
         $tableIndex['non_unique'] = (bool) $tableIndex['non_unique'];
         $tableIndex['primary'] = (bool) $tableIndex['primary'];
         $tableIndex['flags'] = $tableIndex['flags'] ? array($tableIndex['flags']) : null;
     }
     return parent::_getPortableTableIndexesList($tableIndexRows, $tableName);
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:12,代码来源:SQLServerSchemaManager.php

示例2: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     $indexes = array();
     foreach ($tableIndexes as $k) {
         $k['primary'] = (bool) $k['primary'];
         $indexes[] = $k;
     }
     return parent::_getPortableTableIndexesList($indexes, $tableName);
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:12,代码来源:DrizzleSchemaManager.php

示例3: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     foreach ($tableIndexes as $k => $v) {
         $v = array_change_key_case($v, CASE_LOWER);
         if ($v['key_name'] == 'PRIMARY') {
             $v['primary'] = true;
         } else {
             $v['primary'] = false;
         }
         if (strpos($v['index_type'], 'FULLTEXT') !== false) {
             $v['flags'] = array('FULLTEXT');
         }
         $tableIndexes[$k] = $v;
     }
     return parent::_getPortableTableIndexesList($tableIndexes, $tableName);
 }
开发者ID:Nercury,项目名称:dbal,代码行数:19,代码来源:MySqlSchemaManager.php

示例4: _getPortableTableIndexesList

 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     //return array();// @todo метод должен возвращать индексы (как я понял исключая Первичные ключи)
     foreach ($tableIndexes as $k => $v) {
         $v = array_change_key_case($v, CASE_LOWER);
         if ($v['key_name'] == 'PRIMARY') {
             $v['primary'] = true;
         } else {
             $v['primary'] = false;
         }
         if (strpos($v['index_type'], 'FULLTEXT') !== false) {
             $v['flags'] = array('FULLTEXT');
         }
         $tableIndexes[$k] = $v;
     }
     return parent::_getPortableTableIndexesList($tableIndexes, $tableName);
 }
开发者ID:yapro,项目名称:doctrine2-orientdb-restful-driver,代码行数:17,代码来源:SchemaManager.php

示例5: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  *
  * @license New BSD License
  * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     $indexBuffer = array();
     foreach ($tableIndexes as $tableIndex) {
         $tableIndex = \array_change_key_case($tableIndex, CASE_LOWER);
         $keyName = strtolower($tableIndex['name']);
         if (strtolower($tableIndex['is_primary']) == "p") {
             $keyName = 'primary';
             $buffer['primary'] = true;
             $buffer['non_unique'] = false;
         } else {
             $buffer['primary'] = false;
             $buffer['non_unique'] = $tableIndex['is_unique'] == 0 ? true : false;
         }
         $buffer['key_name'] = $keyName;
         $buffer['column_name'] = $this->getQuotedIdentifierName($tableIndex['column_name']);
         $indexBuffer[] = $buffer;
     }
     return parent::_getPortableTableIndexesList($indexBuffer, $tableName);
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:26,代码来源:OracleSchemaManager.php

示例6: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  *
  * @license New BSD License
  * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     $indexBuffer = array();
     // fetch primary
     $stmt = $this->_conn->executeQuery("PRAGMA TABLE_INFO ('{$tableName}')");
     $indexArray = $stmt->fetchAll(\PDO::FETCH_ASSOC);
     usort($indexArray, function ($a, $b) {
         if ($a['pk'] == $b['pk']) {
             return $a['cid'] - $b['cid'];
         }
         return $a['pk'] - $b['pk'];
     });
     foreach ($indexArray as $indexColumnRow) {
         if ($indexColumnRow['pk'] != "0") {
             $indexBuffer[] = array('key_name' => 'primary', 'primary' => true, 'non_unique' => false, 'column_name' => $indexColumnRow['name']);
         }
     }
     // fetch regular indexes
     foreach ($tableIndexes as $tableIndex) {
         // Ignore indexes with reserved names, e.g. autoindexes
         if (strpos($tableIndex['name'], 'sqlite_') !== 0) {
             $keyName = $tableIndex['name'];
             $idx = array();
             $idx['key_name'] = $keyName;
             $idx['primary'] = false;
             $idx['non_unique'] = $tableIndex['unique'] ? false : true;
             $stmt = $this->_conn->executeQuery("PRAGMA INDEX_INFO ('{$keyName}')");
             $indexArray = $stmt->fetchAll(\PDO::FETCH_ASSOC);
             foreach ($indexArray as $indexColumnRow) {
                 $idx['column_name'] = $indexColumnRow['name'];
                 $indexBuffer[] = $idx;
             }
         }
     }
     return parent::_getPortableTableIndexesList($indexBuffer, $tableName);
 }
开发者ID:cuppyzh,项目名称:go_laundry,代码行数:42,代码来源:SqliteSchemaManager.php

示例7: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  *
  * @license New BSD License
  * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     $buffer = array();
     foreach ($tableIndexes as $row) {
         $colNumbers = explode(' ', $row['indkey']);
         $colNumbersSql = 'IN (' . join(' ,', $colNumbers) . ' )';
         $columnNameSql = "SELECT attnum, attname FROM pg_attribute\n                WHERE attrelid={$row['indrelid']} AND attnum {$colNumbersSql} ORDER BY attnum ASC;";
         $stmt = $this->_conn->executeQuery($columnNameSql);
         $indexColumns = $stmt->fetchAll();
         // required for getting the order of the columns right.
         foreach ($colNumbers as $colNum) {
             foreach ($indexColumns as $colRow) {
                 if ($colNum == $colRow['attnum']) {
                     $buffer[] = array('key_name' => $row['relname'], 'column_name' => trim($colRow['attname']), 'non_unique' => !$row['indisunique'], 'primary' => $row['indisprimary'], 'where' => $row['where']);
                 }
             }
         }
     }
     return parent::_getPortableTableIndexesList($buffer, $tableName);
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:26,代码来源:PostgreSqlSchemaManager.php

示例8: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  */
 protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null)
 {
     foreach ($tableIndexRows as &$tableIndex) {
         $tableIndex['primary'] = (bool) $tableIndex['primary'];
         $tableIndex['flags'] = array();
         if ($tableIndex['clustered']) {
             $tableIndex['flags'][] = 'clustered';
         }
         if ($tableIndex['with_nulls_not_distinct']) {
             $tableIndex['flags'][] = 'with_nulls_not_distinct';
         }
         if ($tableIndex['for_olap_workload']) {
             $tableIndex['flags'][] = 'for_olap_workload';
         }
     }
     return parent::_getPortableTableIndexesList($tableIndexRows, $tableName);
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:20,代码来源:SQLAnywhereSchemaManager.php

示例9: _getPortableTableIndexesList

 /**
  * {@inheritdoc}
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     $indexesByColumns = array();
     foreach ($tableIndexes as $k => $v) {
         $v = array_change_key_case($v, CASE_LOWER);
         foreach (range(1, 16) as $i) {
             if (!empty($v["col{$i}"])) {
                 $indexesByColumns[] = array('column_name' => $v["col{$i}"], 'key_name' => $v['constrname'] ?: $v['idxname'], 'non_unique' => $v['idxtype'] == 'D', 'primary' => $v['constrtype'] == 'P');
             }
         }
     }
     return parent::_getPortableTableIndexesList($indexesByColumns, $tableName);
 }
开发者ID:josemalonsom,项目名称:ifx4dd,代码行数:16,代码来源:InformixSchemaManager.php

示例10: _getPortableTableIndexesList

 /**
  * @param  array $tableIndexes
  * @param  string $tableName
  * @return array
  */
 protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
 {
     $indexBuffer = array();
     foreach ($tableIndexes as $tableIndex) {
         if ($tableIndex['index_type'] === "PRIMARY") {
             $keyName = 'primary';
             $buffer['primary'] = true;
             $buffer['non_unique'] = false;
         } else {
             $buffer['primary'] = false;
             $buffer['non_unique'] = $tableIndex['is_unique'] === 'NO';
         }
         $buffer['key_name'] = $tableIndex['index_name'];
         $buffer['column_name'] = $tableIndex['column_name'];
         $indexBuffer[] = $buffer;
     }
     return parent::_getPortableTableIndexesList($indexBuffer, $tableName);
 }
开发者ID:rpeterson,项目名称:laravel-fdb,代码行数:23,代码来源:FoundationDBSQLSchemaManager.php


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