Development

Changeset 10808

You must first sign up to be able to contribute.

Changeset 10808

Show
Ignore:
Timestamp:
08/12/08 15:30:29 (3 months ago)
Author:
francois
Message:

sfPropelFinderPlugin Preparing 0.4.0 Release

Files:

Legend:

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

    r10805 r10808  
    1111* a compatibility layer to allow plugins to work with both Propel and Doctrine 
    1212 
     13Warning: The Doctrine implementation is not yet complete. The syntax described below works completely with Propel 1.2 and 1.3, and partially with doctrine 0.11. 
     14 
    1315Overview 
    1416-------- 
     
    4446* Install the plugin 
    4547   
    46         > php symfony plugin-install http://plugins.symfony-project.com/sfPropelFinderPlugin 
     48        > php symfony plugin-install http://plugins.symfony-project.com/DbFinderPlugin 
    4749 
    4850* Clear the cache 
     
    239241### Complex logic 
    240242 
    241     // where() and _or() only allow simple logical operations on a single condition 
     243    // where() and orWhere() only allow simple logical operations on a single condition 
    242244    // For more complex logic, you have to use combine() 
    243245    // It expects an array of named conditions to be combined, and an operator 
     
    347349Warning: The `withColumn()` feature requires symfony's Behavior system. It will only work if you enable behaviors in `propel.ini` and rebuild your model afterwards. 
    348350 
    349  
    350351    $article = DbFinder::from('Article')-> 
    351352      join('Category')-> 
     
    398399 
    399400### Getting a paginated list of results 
    400  
    401401 
    402402    // Getting an initialized sfPropelPager object 
     
    451451You can create a new finder for your objects, with custom methods. The only prerequisites are to extend `DbFinder`, and to define a protected `$class` property. 
    452452 
    453 For instance, you can create an child of `sfModelFinder` to retrieve Propel `Article` objects. This new finder has access to a protected query object by way of `getQueryObject()`. This object is a Propel Criteria that can be augmented in the usual way. Don't forget to return the current object (`$this`) in the new methods. 
     453For instance, you can create an child of `DbFinder` to retrieve Propel `Article` objects. This new finder has access to a protected query object by way of `getQueryObject()`. This object is a Propel Criteria that can be augmented in the usual way. Don't forget to return the current object (`$this`) in the new methods. 
    454454 
    455455    class ArticleFinder extends DbFinder 
     
    469469      find(); 
    470470 
    471 **Tip**: Once you define an `ArticleFinder` class, any call to `DbFinder::from('Article')` will return an instance of `ArticleFinder` instead of an instance of `DbFinder`. This also means that you can use the finder API to query model objects that are not backed by any ORM at all. 
     471**Tip**: Once you define an `ArticleFinder` class, any call to `DbFinder::from('Article')` will return an instance of `ArticleFinder` instead of an instance of `DbFinder`. So the following also works: 
     472 
     473    $articleFinder = DbFinder::from('Article')-> 
     474      recent()-> 
     475      orderByTitle()-> 
     476      find(); 
     477 
     478This also means that you can use the finder API to query model objects that are not backed by any ORM at all. 
    472479 
    473480### Finding Objects From A Primary Key 
     
    525532* Handle self-referencing relationships (e.g. parent_id), especially in with() 
    526533* Handle multiple references to the same table (c.f. getFooRelatedByBarId()) 
    527 * Put as a parent class in the PeerBuilder so that every Peer class can be a finder 
    528 * Merge with sfPropelImpersonatorPlugin! 
    529534* Implement iterator interface? That way, the query is only executed upon a foreach or an array access... And the finder can be seen as a collection 
    530535* Column finder, which provides an easy interface to Creole (and PDO) for retrieval of columns instead of objects? 
     
    533538--------- 
    534539 
    535 ### 2008-08-12 | Trunk 
    536  
     540### 2008-08-12 | 0.4.0 Beta 
     541 
     542* francois: Renamed the plugin to `DbFinder` 
    537543* francois: Added `finder_methods` parameter in `generator.yml` 
    538544* francois: Implemented `not in` comparison in `sfDoctrineFinder::where()` 
  • plugins/sfPropelFinderPlugin/package.xml

    r10168 r10808  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.4.1" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> 
    3   <name>sfPropelFinderPlugin</name> 
     3  <name>DbFinderPlugin</name> 
    44  <channel>pear.symfony-project.com</channel> 
    5   <summary>Propel object finder</summary> 
    6   <description>The `sfPropelFinder` is a symfony plugin that provides an easy API for finding Propel objects - that is, easier than the Peer methods and the Criteria stuff.</description> 
     5  <summary>The `DbFinder` is a symfony plugin that provides an easy API for finding Model objects, whether the underlying ORM is Propel or Doctrine.</summary> 
     6  <description>`DbFinder` can be seen as: 
     7 
     8  * a usability layer to ease the use of Propel's Criteria object and Peer classes 
     9  * an extension to Propel's limited capabilities to provide: 
     10    - complex joins 
     11    - custom hydration of related objects and columns 
     12    - schema and relation introspection 
     13  * a compatibility layer to allow plugins to work with both Propel and Doctrine 
     14  </description> 
    715  <lead> 
    816    <name>Francois Zaninotto</name> 
     
    1119    <active>yes</active> 
    1220  </lead> 
    13   <date>2008-07-07</date> 
     21  <date>2008-08-12</date> 
    1422  <version> 
    15     <release>0.3.0</release> 
    16     <api>0.3.0</api> 
     23    <release>0.4.0</release> 
     24    <api>0.4.0</api> 
    1725  </version> 
    1826  <stability> 
     
    2533    <dir name="/"> 
    2634      <file name="README" role="data"/> 
     35      <file name="README_generator" role="data"/> 
    2736      <file name="LICENSE" role="data"/> 
     37      <dir name="data"> 
     38        <dir name="generator"> 
     39          <dir name="DbFinderAdmin"> 
     40            <dir name="default"> 
     41              <dir name="skeleton"> 
     42                <dir name="actions"> 
     43                  <file name="actions.class.php" role="data"/> 
     44                </dir> 
     45                <dir name="config"> 
     46                  <file name="generator.yml" role="data"/> 
     47                </dir> 
     48                <dir name="templates"/> 
     49                <dir name="validate"/> 
     50              </dir> 
     51              <dir name="template"> 
     52                <dir name="actions"> 
     53                  <file name="actions.class.php" role="data"/> 
     54                </dir> 
     55                <dir name="templates"> 
     56                  <file name="_edit_actions.php" role="data"/> 
     57                  <file name="_edit_footer.php" role="data"/> 
     58                  <file name="_edit_form.php" role="data"/> 
     59                  <file name="_edit_header.php" role="data"/> 
     60                  <file name="_edit_messages.php" role="data"/> 
     61                  <file name="_filters.php" role="data"/> 
     62                  <file name="_list.php" role="data"/> 
     63                  <file name="_list_actions.php" role="data"/> 
     64                  <file name="_list_footer.php" role="data"/> 
     65                  <file name="_list_header.php" role="data"/> 
     66                  <file name="_list_messages.php" role="data"/> 
     67                  <file name="_list_td_actions.php" role="data"/> 
     68                  <file name="_list_td_stacked.php" role="data"/> 
     69                  <file name="_list_td_tabular.php" role="data"/> 
     70                  <file name="_list_th_stacked.php" role="data"/> 
     71                  <file name="_list_th_tabular.php" role="data"/> 
     72                  <file name="editSuccess.php" role="data"/> 
     73                  <file name="listSuccess.php" role="data"/> 
     74                </dir> 
     75              </dir> 
     76            </dir> 
     77          </dir> 
     78        </dir> 
     79      </dir> 
    2880      <dir name="lib"> 
     81        <dir name="generator"> 
     82          <file name="DbFinderAdminGenerator.class.php" role="data"/> 
     83        </dir> 
     84        <file name="DbFinder.php" role="data"/> 
     85        <file name="sfDoctrineFinder.php" role="data"/> 
     86        <file name="sfDoctrineFinderListener.php" role="data"/> 
     87        <file name="sfModelFinder.php" role="data"/> 
    2988        <file name="sfPropelFinder.php" role="data"/> 
    3089        <file name="sfPropelFinderPager.php" role="data"/>