Changeset 10546
- Timestamp:
- 07/31/08 17:44:32 (4 months ago)
- Files:
-
- plugins/sfPropelFinderPlugin/README (modified) (2 diffs)
- plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php (modified) (1 diff)
- plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderPagerTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelFinderPlugin/README
r10545 r10546 613 613 === 2008-07-31 | Trunk === 614 614 615 * mrhyde: Added `sfPropelFinder::groupByClass()` to ease PostgreSQL grouping 615 * windock: Fixed issue with `paginate()` when called by children of `sfPropelPager` 616 * mrhyde: Added `sfPropelFinder::groupByClass()` to ease PostgreSQL grouping 616 617 * francois: Fixed problem with table alias and PostgreSQL (based on a patch by mrhyde) 617 * mrhyde: Fixed problem with group by clauses being ripped off by pager618 * mrhyde: Fixed problem with group by clauses being ripped off by pager 618 619 * francois: Implemented `DbFinder::toArray()`, `DbFinder::__toString()` and `DbFinder::toHtml()` 619 620 * francois: Implemented `sfDoctrineFinder::findBy()`, `findOneBy()`, `findPk()`, and initialized `where()` … … 641 642 * francois: Added `sfPropelFinder::findFirst()` and `sfPropelFinder::findLast()` methods 642 643 * francois: Added `sfPropelFinder::withColumn()` method 643 * jug: Fixed problem in a particular join case644 * jug: Fixed problem in a particular join case 644 645 * francois: Added `sfPropelFinder::with()` method (based on `sfPropelObjectPeerImpersonator::populateObjects()` code by hartym) 645 646 * francois: Added support for magic `andXXX()` and `orXXX()` methods. 646 * jug: Fixed `_and()` and `_or()` so that they give expected results, rather than the buggy results of Propel's `addAnd()` and `addOr()`647 * jug: Fixed `_and()` and `_or()` so that they give expected results, rather than the buggy results of Propel's `addAnd()` and `addOr()` 647 648 648 649 === 2008-03-31 | 0.2.0 Beta === plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php
r10545 r10546 292 292 public function paginate($page = 1, $maxPerPage = 10, $con = null) 293 293 { 294 $pager = new sfPropelFinderPager($this->class, $maxPerPage); 294 // Children of sfPropelPager don't have a $class property, so we need to guess it 295 $class = isset($this->class) ? $this->class : sfPropelFinderUtils::getClassFromPeerClass($this->peerClass); 296 $pager = new sfPropelFinderPager($class, $maxPerPage); 295 297 $pager->setFinder($this); 296 298 $pager->setConnection($con); plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderPagerTest.php
r10542 r10546 51 51 ArticlePeer::doDeleteAll(); 52 52 53 $t = new lime_test( 29, new lime_output_color());53 $t = new lime_test(30, new lime_output_color()); 54 54 55 55 $article1 = new Article(); … … 136 136 $pager->getResults(); 137 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()'); 138 139 $t->diag('sfPropelFinderPager issues with object finders classes'); 140 class ArticleFinder extends sfPropelFinder 141 { 142 protected $peerClass = 'ArticlePeer'; 143 } 144 $finder = new ArticleFinder(); 145 try 146 { 147 $pager = $finder->paginate(); 148 $t->pass('Children of sfPropelFinder can use paginate()'); 149 } 150 catch(sfException $e) 151 { 152 $t->fail('Children of sfPropelFinder can use paginate()'); 153 }