Changeset 10542
- Timestamp:
- 07/31/08 16:25:25 (4 months ago)
- Files:
-
- plugins/sfPropelFinderPlugin/README (modified) (1 diff)
- plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php (modified) (1 diff)
- plugins/sfPropelFinderPlugin/lib/sfPropelFinderPager.php (modified) (2 diffs)
- plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderPagerTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelFinderPlugin/README
r10540 r10542 608 608 === 2008-07-31 | Trunk === 609 609 610 * mrhyde: Fixed problem with group by clauses being ripped off by pager 610 611 * francois: Implemented `DbFinder::toArray()`, `DbFinder::__toString()` and `DbFinder::toHtml()` 611 612 * francois: Implemented `sfDoctrineFinder::findBy()`, `findOneBy()`, `findPk()`, and initialized `where()` plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php
r10344 r10542 1055 1055 } 1056 1056 1057 /** 1058 * Cloning instance should clone its components. 1059 * 1060 * Solves problems with sfPropelFinderPager. 1061 */ 1062 public function __clone() 1063 { 1064 $this->criteria = clone $this->criteria; 1065 } 1066 1057 1067 public function __call($name, $arguments) 1058 1068 { plugins/sfPropelFinderPlugin/lib/sfPropelFinderPager.php
r10047 r10542 18 18 } 19 19 20 21 /** 22 * Set finder object for the pager 23 * 24 * @param sfPropelFinder $finder 25 * @return void 26 */ 27 public function setFinder($finder) 28 { 29 $this->finder = $finder; 30 } 31 20 32 /** 21 33 * Get the finder for the pager … … 47 59 { 48 60 return $this->connection; 49 }50 51 /**52 * Set finder object for the pager53 *54 * @param sfPropelFinder $finder55 * @return void56 */57 public function setFinder($finder)58 {59 $this->finder = $finder;60 61 } 61 62 plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderPagerTest.php
r10047 r10542 51 51 ArticlePeer::doDeleteAll(); 52 52 53 $t = new lime_test(2 7, new lime_output_color());53 $t = new lime_test(29, new lime_output_color()); 54 54 55 55 $article1 = new Article(); … … 127 127 $t->is($pager->getLastPage(), 2, 'sfPropelFinder::paginate() sfPropelFinder::paginate() uses the internal conditions'); 128 128 $t->is($pager->getFirstIndice(), 1, 'sfPropelFinder::paginate() sfPropelFinder::paginate() uses the internal conditions'); 129 130 $t->diag('sfPropelFinderPager issues with GroupBy'); 131 $finder = sfPropelFinder::from('Article')->groupBy('Title'); 132 $pager = new sfPropelFinderPager('Article', 2); 133 $pager->setFinder($finder); 134 $pager->init(); 135 $t->is($con->getLastExecutedQuery(), 'SELECT COUNT(article.ID) FROM article', 'sfPropelFinderPager::init() removes groupBy clauses and issues a count()'); 136 $pager->getResults(); 137 $t->is($con->getLastExecutedQuery(), 'SELECT article.ID, article.TITLE, article.CATEGORY_ID FROM article GROUP BY article.TITLE LIMIT 2', 'sfPropelFinderPager::getResults() does not remove groupBy clauses and issues a elect()');