Changeset 3947
- Timestamp:
- 03/08/08 04:39:48 (16 months ago)
- Location:
- branches/0.10
- Files:
-
- 3 modified
-
lib/Doctrine/Query.php (modified) (4 diffs)
-
lib/Doctrine/Query/Abstract.php (modified) (1 diff)
-
tests/QueryTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/lib/Doctrine/Query.php
r3945 r3947 506 506 // check for wildcards 507 507 if (in_array('*', $fields)) { 508 //echo "<br />";Doctrine::dump($table->getColumnNames()); echo "<br />";509 508 $fields = $table->getFieldNames(); 510 509 } else { … … 537 536 538 537 $this->_neededTables[] = $tableAlias; 539 //Doctrine::dump(implode(', ', $sql)); 540 //echo "<br /><br />"; 538 541 539 return implode(', ', $sql); 542 540 } … … 1847 1845 * Copies a Doctrine_Query object. 1848 1846 * 1849 * @param Doctrine_Query Doctrine query instance.1850 * If ommited the instance itself will be used as source.1851 1847 * @return Doctrine_Query Copy of the Doctrine_Query instance. 1852 1848 */ … … 1860 1856 1861 1857 return $new; 1858 } 1859 1860 /** 1861 * __clone 1862 * 1863 * @return void 1864 */ 1865 public function __clone() 1866 { 1867 $this->_parsers = array(); 1862 1868 } 1863 1869 -
branches/0.10/lib/Doctrine/Query/Abstract.php
r3901 r3947 456 456 public function removeSqlQueryPart($name) 457 457 { 458 try {459 458 if ( ! isset($this->_sqlParts[$name])) { 460 459 throw new Doctrine_Query_Exception('Unknown query part ' . $name); 461 }} 462 catch (Exception $e) {echo $e->getTraceAsString(); echo "<br /><br /><br />";} 463 460 } 461 464 462 if ($name == 'limit' || $name == 'offset') { 465 $this->_sqlParts[$name] = false;463 $this->_sqlParts[$name] = false; 466 464 } else { 467 $this->_sqlParts[$name] = array(); 468 } 465 $this->_sqlParts[$name] = array(); 466 } 467 469 468 return $this; 470 469 } -
branches/0.10/tests/QueryTestCase.php
r3884 r3947 112 112 $this->assertTrue($q->count(), 1); 113 113 } 114 115 public function testQueryCopyClone() 116 { 117 $query = new Doctrine_Query(); 118 $query->select('u.*')->from('User u'); 119 $sql = $query->getSql(); 120 121 $data = $query->execute(); 122 $query2 = $query->copy(); 123 124 $this->assertTrue($sql, $query2->getSql()); 125 126 $query2->limit(0); 127 $query2->offset(0); 128 $query2->select('COUNT(u.id) as nb'); 129 130 $this->assertTrue($query2->getSql(), 'SELECT COUNT(e.id) AS e__0 FROM entity e WHERE (e.type = 0)'); 131 } 114 132 } 115 133 class MyQuery extends Doctrine_Query