Development

Changeset 10592

You must first sign up to be able to contribute.

Changeset 10592

Show
Ignore:
Timestamp:
08/01/08 18:02:07 (4 months ago)
Author:
francois
Message:

sfPropelFinderPlugin Added DbFinderAdminGenerator (see new README for details) (WIP)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelFinderPlugin/README

    r10549 r10592  
    611611== Changelog == 
    612612 
    613 === 2008-07-31 | Trunk === 
    614  
     613=== 2008-08-01 | Trunk === 
     614 
     615 * francois: Added `DbFinderAdminGenerator` (WIP) 
    615616 * francois: Fixed problem with `join()` and `with()` when called by children of `sfPropelPager` 
    616617 * windock:  Fixed problem with `paginate()` when called by children of `sfPropelPager` 
  • plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php

    r10549 r10592  
    449449          { 
    450450            $startCol = $withObj->hydrate($row, $startCol); 
     451          } 
     452           
     453          // As we can be in a left join, there is a possibility that the hydrated related object is null 
     454          // In this case, we must not relate it to the main object 
     455          $isEmpty = true; 
     456          foreach ($withObj->toArray() as $value) 
     457          { 
     458            if($value !== null) 
     459            { 
     460              $isEmpty = false; 
     461            } 
     462          } 
     463          if($isEmpty) 
     464          { 
     465            break; 
    451466          } 
    452467           
  • plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderRelationsTest.php

    r10549 r10592  
    7979$con = Propel::getConnection(); 
    8080 
    81 $t = new lime_test(81, new lime_output_color()); 
     81$t = new lime_test(82, new lime_output_color()); 
    8282 
    8383$t->diag('findRelation()'); 
     
    495495} 
    496496 
     497$t->diag('sfPropelFinder::with() and left joins'); 
     498 
     499ArticlePeer::doDeleteAll(); 
     500CategoryPeer::doDeleteAll(); 
     501 
     502$category1 = new Category(); 
     503$category1->setName('cat1'); 
     504$category1->save(); 
     505$article1 = new Article(); 
     506$article1->setTitle('aaa'); 
     507$article1->setCategory($category1); 
     508$article1->save(); 
     509$article2 = new Article(); 
     510$article2->setTitle('bbb'); 
     511$article2->save(); 
     512 
     513$article = sfPropelFinder::from('Article')->leftJoin('Category')->with('Category')->findLast(); 
     514$t->isa_ok($article->getCategory(), 'NULL', 'In a left join using with(), empty related objects are not hydrated');