mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 04:39:55 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,53 +1,65 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /classes/db/queryparts/table
|
||||
* @version 0.1
|
||||
*/
|
||||
class MssqlTableWithHint extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /classes/db/queryparts/table
|
||||
* @version 0.1
|
||||
* table name
|
||||
* @var string
|
||||
*/
|
||||
class MssqlTableWithHint extends Table {
|
||||
/**
|
||||
* table name
|
||||
* @var string
|
||||
*/
|
||||
var $name;
|
||||
/**
|
||||
* table alias
|
||||
* @var string
|
||||
*/
|
||||
var $alias;
|
||||
/**
|
||||
* index hint type, ex) IGNORE, FORCE, USE...
|
||||
* @var array
|
||||
*/
|
||||
var $index_hints_list;
|
||||
var $name;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $name
|
||||
* @param string $alias
|
||||
* @param string $index_hints_list
|
||||
* @return void
|
||||
*/
|
||||
function MssqlTableWithHint($name, $alias = NULL, $index_hints_list){
|
||||
parent::Table($name, $alias);
|
||||
$this->index_hints_list = $index_hints_list;
|
||||
}
|
||||
/**
|
||||
* table alias
|
||||
* @var string
|
||||
*/
|
||||
var $alias;
|
||||
|
||||
function toString(){
|
||||
$result = parent::toString();
|
||||
/**
|
||||
* index hint type, ex) IGNORE, FORCE, USE...
|
||||
* @var array
|
||||
*/
|
||||
var $index_hints_list;
|
||||
|
||||
$index_hint_string = '';
|
||||
$indexTypeList = array('USE'=>1, 'FORCE'=>1);
|
||||
foreach($this->index_hints_list as $index_hint){
|
||||
$index_hint_type = $index_hint->getIndexHintType();
|
||||
if(isset($indexTypeList[$index_hint_type]))
|
||||
$index_hint_string .= 'INDEX(' . $index_hint->getIndexName() . '), ';
|
||||
}
|
||||
if($index_hint_string != ''){
|
||||
$result .= ' WITH(' . substr($index_hint_string, 0, -2) . ') ';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
* @param string $name
|
||||
* @param string $alias
|
||||
* @param string $index_hints_list
|
||||
* @return void
|
||||
*/
|
||||
function MssqlTableWithHint($name, $alias = NULL, $index_hints_list)
|
||||
{
|
||||
parent::Table($name, $alias);
|
||||
$this->index_hints_list = $index_hints_list;
|
||||
}
|
||||
|
||||
?>
|
||||
function toString()
|
||||
{
|
||||
$result = parent::toString();
|
||||
|
||||
$index_hint_string = '';
|
||||
$indexTypeList = array('USE' => 1, 'FORCE' => 1);
|
||||
foreach($this->index_hints_list as $index_hint)
|
||||
{
|
||||
$index_hint_type = $index_hint->getIndexHintType();
|
||||
if(isset($indexTypeList[$index_hint_type]))
|
||||
{
|
||||
$index_hint_string .= 'INDEX(' . $index_hint->getIndexName() . '), ';
|
||||
}
|
||||
}
|
||||
if($index_hint_string != '')
|
||||
{
|
||||
$result .= ' WITH(' . substr($index_hint_string, 0, -2) . ') ';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file MssqlTableWithHint.class.php */
|
||||
/* Location: ./classes/db/queryparts/table/MssqlTableWithHint.class.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue