XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
HintTableTag.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
12 class HintTableTag extends TableTag
13 {
14 
19  var $index;
20 
28  function __construct($table, $index)
29  {
30  parent::__construct($table);
31  $this->index = $index;
32  }
33 
34  function getTableString()
35  {
36  $dbParser = DB::getParser();
37  $dbType = ucfirst(Context::getDBType());
38 
39  $result = sprintf('new %sTableWithHint(\'%s\'%s, array('
40  , !strncasecmp($dbType, 'Mysql', 5) ? 'Mysql' : $dbType
41  , $dbParser->escape($this->name)
42  , $this->alias ? ', \'' . $dbParser->escape($this->alias) . '\'' : ', null'
43  //, ', \'' . $dbParser->escape($this->index->name) .'\', \'' . $this->index->type .'\''
44  );
45  foreach($this->index as $indx)
46  {
47  $result .= "new IndexHint(";
48  $result .= '\'' . $dbParser->escape($indx->name) . '\', \'' . $indx->type . '\'' . ') , ';
49  }
50  $result = substr($result, 0, -2);
51  $result .= '))';
52  return $result;
53  }
54 
55  function getArguments()
56  {
57  if(!isset($this->conditionsTag))
58  {
59  return array();
60  }
61  return $this->conditionsTag->getArguments();
62  }
63 
64 }
65 /* End of file HintTableTag.class.php */
66 /* Location: ./classes/xml/xmlquery/tags/table/HintTableTag.class.php */
getParser($force=FALSE)
Definition: DB.class.php:1345
__construct($table, $index)