Dropped index hinting support

Never gets used, ended up being somewhat MySQL specific as PostgreSQL favors
letting the server handle it instead of hinting at it. Write better queries I
suppose?
This commit is contained in:
Joshua Sherman 2014-01-17 13:14:36 -05:00
parent 57a5b0c2c0
commit 68365142e7

View file

@ -132,16 +132,6 @@ class Model extends Object
*/
protected $joins = false;
/**
* [Index] Hints
*
* SQL: USE INDEX
*
* @access protected
* @var mixed
*/
protected $hints = false;
/**
* Conditions
*
@ -748,33 +738,6 @@ class Model extends Object
}
}
// Adds the index hints
if ($this->hints != false)
{
if (is_array($this->hints))
{
foreach ($this->hints as $hint => $columns)
{
if (is_array($columns))
{
$this->sql[] = $hint . ' (' . implode(', ', $columns) . ')';
}
else
{
$format = (stripos($columns, 'USE ') === false);
$this->sql[] = ($format ? 'USE INDEX (' : '') . $columns . ($format ? ')' : '');
}
}
}
else
{
$format = (stripos($this->hints, 'USE ') === false);
$this->sql[] = ($format ? 'USE INDEX (' : '') . $this->hints . ($format ? ')' : '');
}
}
// Adds the WHERE conditionals
if ($this->conditions != false)
{
@ -1658,7 +1621,7 @@ class Model extends Object
$key = trim(strtolower($key));
// Assigns valid keys to the appropriate class property
if (in_array($key, ['fields', 'table', 'joins', 'hints', 'conditions', 'group', 'having', 'order', 'limit', 'offset']))
if (in_array($key, ['fields', 'table', 'joins', 'conditions', 'group', 'having', 'order', 'limit', 'offset']))
{
$this->$key = $value;
$conditions = false;