root/trunk/application/libraries/Ignitedquery.php
| 277 | 279 | ||
|---|---|---|---|
388 | { | 388 | { |
389 | $this->q_cached = false; | 389 | $this->q_cached = false; |
390 | 390 | ||
391 | // reset select if it is the default "*" | ||
392 | if(is_string($this->q_select)) | ||
393 | { | ||
394 | $this->q_select = array(); | ||
395 | } | ||
396 | |||
391 | if($cols === false) | 397 | if($cols === false) |
392 | { | 398 | { |
393 | $obj = new IgnitedQuery(); | 399 | $obj = new IgnitedQuery(); |
... | ... | ||
396 | return $obj; | 402 | return $obj; |
397 | } | 403 | } |
398 | 404 | ||
399 | // reset select if it is the default "*" | ||
400 | if(is_string($this->q_select)) | ||
401 | { | ||
402 | $this->q_select = array(); | ||
403 | } | ||
404 | | ||
405 | if(is_array($cols)) | 405 | if(is_array($cols)) |
406 | { | 406 | { |
407 | // many columns in array | 407 | // many columns in array |
... | ... | ||
1452 | 1452 | ||
1453 | /** | 1453 | /** |
1454 | * Specifies an alias for this subquery. | 1454 | * Specifies an alias for this subquery. |
1455 | * | 1455 | * |
1456 | * Note: This only applies if this object is a subquery | 1456 | * Note: This only applies if this object is a subquery |
1457 | * | 1457 | * |
1458 | * @access public | 1458 | * @access public |
1459 | * @param string The alias | 1459 | * @param string The alias |
1460 | * | 1460 | * @param bool If to protect identifiers |
1461 | * | ||
1461 | * @return $this | 1462 | * @return $this |
1462 | */ | 1463 | */ |
1463 | function &alias($alias) | 1464 | function &alias($alias, $protect_identifiers = true) |
1464 | { | 1465 | { |
1465 | if($this->q_as !== false) | 1466 | if($this->q_as !== false) |
1466 | $this->q_as = $this->_protect_identifiers($alias); | 1467 | $this->q_as = ($protect_identifiers ? $this->_protect_identifiers($alias) : $alias); |
1467 | | 1468 | |
1468 | return $this; | 1469 | return $this; |
1469 | } | 1470 | } |
1470 | 1471 |
Download diff