Changeset 10549
- Timestamp:
- 07/31/08 18:56:38 (4 months ago)
- Files:
-
- plugins/sfPropelFinderPlugin/README (modified) (1 diff)
- plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php (modified) (1 diff)
- plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderRelationsTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelFinderPlugin/README
r10546 r10549 613 613 === 2008-07-31 | Trunk === 614 614 615 * windock: Fixed issue with `paginate()` when called by children of `sfPropelPager` 615 * francois: Fixed problem with `join()` and `with()` when called by children of `sfPropelPager` 616 * windock: Fixed problem with `paginate()` when called by children of `sfPropelPager` 616 617 * mrhyde: Added `sfPropelFinder::groupByClass()` to ease PostgreSQL grouping 617 618 * francois: Fixed problem with table alias and PostgreSQL (based on a patch by mrhyde) plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php
r10547 r10549 27 27 if($class) 28 28 { 29 // Instanciation with a class 29 30 list($class, $alias) = $this->getClassAndAlias($class); 30 31 $this->class = $class; 31 32 $tmp = new $class; 32 33 $this->setPeerClass(get_class($tmp->getPeer()), $alias); 34 } 35 else if($this->peerClass) 36 { 37 // Instanciation for a child of sfPropelFinder 38 $this->addRelation($this->peerClass); 33 39 } 34 40 if($this->peerClass) plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderRelationsTest.php
r10543 r10549 79 79 $con = Propel::getConnection(); 80 80 81 $t = new lime_test( 79, new lime_output_color());81 $t = new lime_test(81, new lime_output_color()); 82 82 83 83 $t->diag('findRelation()'); … … 468 468 $article = $finder->findOne(); 469 469 $t->is($finder->getLatestQuery(), 'SELECT article.ID, article.TITLE, article.CATEGORY_ID, COUNT(comment.ID) AS NbComments FROM article, comment WHERE article.ID=comment.ARTICLE_ID GROUP BY article.ID ORDER BY NbComments ASC LIMIT 1', 'Columns added with withColumn() can be used for sorting'); 470 471 $t->diag('sfPropelFinder::with() issues with object finders classes'); 472 class ArticleFinder extends sfPropelFinder 473 { 474 protected $peerClass = 'ArticlePeer'; 475 } 476 477 $finder = new ArticleFinder; 478 try 479 { 480 $finder->join('Category')->find(); 481 $t->pass('Relations lookup work also on finder children objects'); 482 } 483 catch (Exception $e) 484 { 485 $t->fail('Relations lookup work also on finder children objects'); 486 } 487 try 488 { 489 $finder->with('Category')->find(); 490 $t->pass('Relations lookup work also on finder children objects'); 491 } 492 catch (Exception $e) 493 { 494 $t->fail('Relations lookup work also on finder children objects'); 495 } 496