Development

Changeset 10666

You must first sign up to be able to contribute.

Changeset 10666

Show
Ignore:
Timestamp:
08/05/08 16:54:22 (4 months ago)
Author:
francois
Message:

sfPropelFinderPlugin: Added more phpdoc to sfPropelFinder and sfDoctrineFinder (closes #3950)

Files:

Legend:

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

    r10664 r10666  
    614614=== 2008-08-05 | Trunk === 
    615615 
     616 * francois: Added more phpdoc to `sfPropelFinder` and `sfDoctrineFinder` 
    616617 * mrhyde:   Fixed issue when calling several termination methods on a finder 
    617618 * francois: Implemented `sfDoctrineFinder::count()` 
  • plugins/sfPropelFinderPlugin/lib/DbFinder.php

    r10655 r10666  
    238238  abstract public function set($values, $forceIndividualSaves = false); 
    239239 
     240  // Hydrating 
     241   
     242  abstract public function with($classes); 
     243  abstract public function withI18n($culture = null); 
     244  abstract public function withColumn($column, $alias = null, $type = null); 
     245   
     246  // Finder Filters 
     247   
     248  abstract public function distinct(); 
     249  abstract public function where(); 
     250  abstract public function _and(); 
     251  abstract public function _or(); 
     252  abstract public function combine($conditions, $operator = 'and', $namedCondition = null); 
     253  abstract public function relatedTo($object); 
     254  abstract public function orderBy($columnName, $order = null); 
     255  abstract public function groupBy($columnName); 
     256  abstract public function groupByClass($class); 
     257  abstract public function guessOrder($direction = 'desc'); 
     258  abstract public function join(); 
     259   
    240260  // Finder utilities 
    241261   
     262  abstract public function keepQuery($keep = true); 
    242263  abstract public function getLatestQuery(); 
    243264  abstract protected function cleanup(); 
  • plugins/sfPropelFinderPlugin/lib/sfDoctrineFinder.php

    r10655 r10666  
    123123  // Finder Executers 
    124124   
     125  /** 
     126   * Returns the number of records matching the finder 
     127   * 
     128   * @param Boolean $distinct Whether the count query has to add a DISTINCT keyword (unsupported) 
     129   * 
     130   * @return integer Number of records matching the finder 
     131   */ 
    125132  public function count($distinct = false) 
    126133  { 
     
    131138  } 
    132139   
     140  /** 
     141   * Executes the finder and returns the matching Doctrine objects 
     142   * 
     143   * @param integer $limit Optional maximum number of results to retrieve 
     144   * 
     145   * @return array A list of Doctrine_Record objects 
     146   */ 
    133147  public function find($limit = null) 
    134148  { 
     
    143157  } 
    144158   
     159  /** 
     160   * Limits the search to a single result, and executes the finder 
     161   * Returns the first Doctrine_Record object matching the finder 
     162   * 
     163   * @return mixed a Doctrine_Record object or null 
     164   */ 
    145165  public function findOne() 
    146166  { 
     
    150170  } 
    151171   
    152   public function findLast($column = null) 
    153   { 
    154     if($column) 
    155     { 
    156       $this->orderBy($column, 'desc'); 
     172  /** 
     173   * Returns the last record matching the finder 
     174   * Optionally, you can specify the column to sort on 
     175   * If no column is passed, the finder guesses the column to use 
     176   * @see guessOrder() 
     177   * 
     178   * @param string $columnName Optional: The column to order by 
     179   * 
     180   * @return mixed a Doctrine_Record object or null 
     181   */ 
     182  public function findLast($columnName = null) 
     183  { 
     184    if($columnName) 
     185    { 
     186      $this->orderBy($columnName, 'desc'); 
    157187    } 
    158188    else 
     
    164194  } 
    165195   
    166   public function findFirst($column = null) 
    167   { 
    168     if($column) 
    169     { 
    170       $this->orderBy($column, 'asc'); 
     196  /** 
     197   * Returns the first record matching the finder 
     198   * Optionally, you can specify the column to sort on 
     199   * If no column is passed, the finder guesses the column to use 
     200   * @see guessOrder() 
     201   * 
     202   * @param string $columnName Optional: The column to order by 
     203   * 
     204   * @return mixed a Doctrine_Record object or null 
     205   */ 
     206  public function findFirst($columnName = null) 
     207  { 
     208    if($columnName) 
     209    { 
     210      $this->orderBy($columnName, 'asc'); 
    171211    } 
    172212    else 
     
    178218  } 
    179219   
     220  /** 
     221   * Adds a condition on a column and returns the records matching the finder 
     222   * 
     223   * @param string $columnName Name of the columns 
     224   * @param mixed $value 
     225   * @param integer $limit Optional maximum number of records to return 
     226   * 
     227   * @return array A list of Doctrine_Record Propel objects 
     228   */ 
    180229  public function findBy($columnName, $value, $limit = null) 
    181230  { 
     
    186235  } 
    187236 
     237  /** 
     238   * Adds a condition on a column and returns the first record matching the finder 
     239   * Useful to retrieve objects by a column which is not the primary key 
     240   * 
     241   * @param string $columnName Name of the columns 
     242   * @param mixed $value 
     243   * 
     244   * @return mixed a Doctrine_Record object or null 
     245   */ 
    188246  public function findOneBy($columnName, $value) 
    189247  { 
     
    194252  } 
    195253   
     254  /** 
     255   * Finds record(s) based on one or several primary keys 
     256   * Takes into account hydrating methods previously called on the finder 
     257   * 
     258   * @param mixed $pk A primary kay, a composite primary key, or an array of primary keys 
     259   * 
     260   * @return mixed One or several Doctrine_Record records (based on the input) 
     261   */ 
    196262  public function findPk($pk) 
    197263  { 
     
    232298  } 
    233299   
     300  /** 
     301   * Deletes the records found by the finder 
     302   * Beware that behaviors based on hooks in the object's delete() method 
     303   * Will only be triggered if you force individual deletes, i.e. if you pass true as first argument 
     304   * 
     305   * @param Boolean $forceIndividualDeletes 
     306   * 
     307   * @return Integer Number of deleted rows 
     308   */ 
    234309  public function delete($forceIndividualDeletes = false) 
    235310  { 
     
    238313  } 
    239314   
     315  /** 
     316   * Prepares a pager based on the finder 
     317   * The pager is initialized (it knows how many pages it contains) 
     318   * But it won't be populated until you call getResults() on it 
     319   * 
     320   * @param integer $page The current page (1 by default) 
     321   * @param integer $maxPerPage The maximum number of results per page (10 by default) 
     322   * 
     323   * @return sfDoctrineFinderPager The initialized pager object 
     324   */ 
    240325  public function paginate($page = 1, $maxPerPage = 10) 
    241326  { 
     
    243328  } 
    244329   
     330  /** 
     331   * Updates the records found by the finder 
     332   * Beware that behaviors based on hooks in the object's save() method 
     333   * Will only be triggered if you force individual saves, i.e. if you pass true as second argument 
     334   * 
     335   * @param Array $values Associative array of keys and values to replace 
     336   * @param Boolean $forceIndividualSaves 
     337   * 
     338   * @return Integer Number of deleted rows 
     339   */ 
    245340  public function set($values, $forceIndividualSaves = false) 
    246341  { 
     
    249344  } 
    250345   
     346  /** 
     347   * Cleans up the query object (if necessary) 
     348   * 
     349   * @return sfDoctrineFinder the current finder object 
     350   */ 
    251351  protected function cleanup() 
    252352  { 
     
    259359  } 
    260360   
    261    
     361  /** 
     362   * Finalizes the query, executes it and hydrates results 
     363   *  
     364   * @return array List of Doctrine_Record objects 
     365   */ 
    262366  public function doFind() 
    263367  { 
     
    277381  // Hydrating 
    278382   
     383  /** 
     384   * Ask the finder to hydrate related records 
     385   * Equivalent to Doctrine's JOIN DQL 
     386   * Examples: 
     387   *   // Article has an author, article has a category, and author has a group 
     388   *   $articleFinder->with('Author')->find(); 
     389   *   $articleFinder->with('Author', 'Category')->find(); 
     390   *   $articleFinder->with('Author', 'Group')->find(); 
     391   *   $articleFinder->join('Author')->with('Group')->find(); 
     392   *   // By default, the finder uses a simple join (where) but you can force another join 
     393   *   $articleFinder->leftJoin('Author')->with('Author')->find(); 
     394   * 
     395   * @return     sfDoctrineFinder the current finder object 
     396   */ 
    279397  public function with($classes) 
    280398  { 
     
    284402  } 
    285403   
     404  /** 
     405   * Ask the finder to hydrate related i18n records 
     406   * 
     407   * @param string $culture Optional culture value. If no culture is given, the current user's culture is used 
     408   * 
     409   * @return     sfDoctrineFinder the current finder object 
     410   */ 
    286411  public function withI18n($culture = null) 
    287412  { 
     
    291416  } 
    292417 
     418  /** 
     419   * Ask the finder to hydrate related columns 
     420   * Columns hydrated by way of withColumn() can be retrieved on the object via getColumn() 
     421   * If the join was not explicitly declared earlier in the finder, it guesses it 
     422   * Examples: 
     423   *   $article = $articleFinder->join('Author')->withColumn('Author.Name')->findOne(); 
     424   *   // The join() can be omitted, in which case the finder will try to guess the join based on the schema 
     425   *   $article = $articleFinder->withColumn('Author.Name')->findOne(); 
     426   *   // Columns added by way of withColumn() can be retrieved by getColumn() 
     427   *   $authorName = $article->getColumn('Author.Name'); 
     428   * 
     429   *   // Alias support 
     430   *   $article = $articleFinder->withColumn('Author.Name', 'authorName')->findOne(); 
     431   *   $authorName = $article->getColumn('authorName'); 
     432   * 
     433   *   // type support 
     434   *   $article = $articleFinder->withColumn('Author.Name', 'authorName', 'string')->findOne(); 
     435   *   $authorName = $article->getColumn('authorName'); 
     436   * 
     437   *   // Support for calculated columns 
     438   *   $articles = articleFinder-> 
     439   *     join('Comment')-> 
     440   *     withColumn('COUNT(comment.ID)', 'NbComments')-> 
     441   *     groupBy('Article.Id')-> 
     442   *     find(); 
     443   * 
     444   * @param string $column The column to add. Can be a calculated column 
     445   * @param string $alias Optional alias for column retrieval 
     446   * @param string $type Optional type converter to be sure the retrieved column has the correct type 
     447   * 
     448   * @return     sfDoctrineFinder the current finder object 
     449   */ 
    293450  public function withColumn($column, $alias = null, $type = null) 
    294451  { 
     
    300457  // Finder Filters 
    301458   
     459  /** 
     460   * Finder Fluid Interface for Doctrine_Query::distinct() 
     461   * 
     462   * @return     sfDoctrineFinder the current finder object 
     463   */ 
    302464  public function distinct() 
    303465  { 
     
    361523   * 
    362524   * @see     where() 
     525   * @return     sfDoctrineFinder the current finder object 
    363526   */ 
    364527  public function _and() 
     
    376539   * @param      string  $value  Value if 3 arguments (optional) 
    377540   * 
    378    * @return     sfPropelFinder the current finder object 
     541   * @return     sfDoctrineFinder the current finder object 
    379542   */ 
    380543  public function _or() 
     
    394557   *  
    395558   * @see where() 
     559   * @return     sfDoctrineFinder the current finder object 
    396560   */ 
    397561  public function combine($conditions, $operator = 'and', $namedCondition = null) 
     
    406570   * Examples: 
    407571   *   $commentFinder->relatedTo($article) 
     572   * 
     573   * @param  Doctrine_Record $object The related object to restrict to 
     574   * 
     575   * @return     sfDoctrineFinder the current finder object 
    408576   */ 
    409577  public function relatedTo($object) 
     
    414582  } 
    415583   
     584  /** 
     585   * Finder Fluid Interface for Doctrine_Query::orderby() 
     586   * Infers $column and $order from $columnName and some optional arguments 
     587   * Examples: 
     588   *   $articleFinder->orderBy('CreatedAt') 
     589   *    => $query->orderBy('Article.created_at asc') 
     590   *   $articlefinder->orderBy('CategoryId', 'desc') 
     591   *    => $query->orderBy('Article.category_id desc') 
     592   * 
     593   * @param string $columnName The column to order by 
     594   * @param string $order      The sorting order. 'asc' by default, also accepts 'desc' 
     595   * 
     596   * @return     sfDoctrineFinder the current finder object 
     597   */ 
    416598  public function orderBy($columnName, $order = 'asc') 
    417599  { 
     
    425607    return $this; 
    426608  } 
    427  
     609   
     610  /** 
     611   * Finder Fluid Interface for Doctrine_Query::groupBy() 
     612   * Infers $column and $order from $columnName and some optional arguments 
     613   * Examples: 
     614   *   $articleFinder->groupBy('CreatedAt') 
     615   *    => $query->groupBy('Article.created_at') 
     616   * 
     617   * @param string $columnName The column to group by 
     618   * 
     619   * @return     sfDoctrineFinder the current finder object 
     620   */ 
    428621  public function groupBy($columnName) 
    429622  { 
     
    433626  } 
    434627   
     628  /** 
     629   * Finder Fluid Interface for Doctrine_Query::groupBy() but this times we add all columns from given class. 
     630   * Examples: 
     631   *   $articleFinder->groupBy('Article') 
     632   *    => $query->groupBy('Article.id')->groupBy('Article.title')->groupBy('Article.created_at') 
     633   * @param string $class 
     634   * 
     635   * @return sfDoctrineFinder the current finder object 
     636   */ 
     637  public function groupByClass($class) 
     638  { 
     639    throw new Exception('This method is not yet implemented'); 
     640     
     641    return $this; 
     642  } 
    435643  /** 
    436644   * Guess sort column based on their names 
     
    455663    } 
    456664     
    457     throw new Exception('Unable to figure out the column to use to order rows in sfPropelFinder::guessOrder()'); 
     665    throw new Exception('Unable to figure out the column to use to order rows in sfDoctrineFinder::guessOrder()'); 
    458666  } 
    459667   
     
    492700  } 
    493701   
    494    
    495   /** 
     702  /** 
     703  * Finder Fluid Interface for Doctrine_Query::join() 
    496704   * Infers $column1, $column2 and $operator from $relatedClass and some optional arguments 
     705   * Uses table introspection to guess the related columns 
     706   * Examples: 
     707   *   $articleFinder->join('Comment') 
     708   *   $articleFinder->join('Category', 'RIGHT JOIN') 
     709   *   $articleFinder->join('Article.CategoryId', 'Category.Id', 'RIGHT JOIN') 
     710   *  
     711   * @param  string $classOrColumn Class to join if 1 argument, first column of the join otherwise 
     712   * @param  string $column Second column of the join if more than 1 argument 
     713   * @param  string $joinType Accepted values are null, 'left join', 'right join', 'inner join' 
     714   * 
     715   * @return     sfDoctrineFinder the current finder object 
    497716   */ 
    498717  public function join() 
     
    503722  } 
    504723   
     724  /** 
     725   * Do no reinitialize the finder object after a termination method 
     726   * By default the Doctrine_Query is wiped off whenever a termination method is called 
     727   * Calling this method with true as parameter will keep the internal Query intact for the next termination method 
     728   * 
     729   * @param  Boolean $keep true (default) or false 
     730   * 
     731   * @return sfDoctrineFinder the current finder object 
     732   */ 
    505733  public function keepQuery($keep = true) 
    506734  { 
     
    515743  } 
    516744   
     745  /** 
     746   * Guess the relation to another class 
     747   * 
     748   * @param string $phpName Doctrine_Record Class name (e.g. 'Article') 
     749   *  
     750   * @return array A list with the two columns member of the relationship 
     751   */ 
    517752  public function getRelation($phpName) 
    518753  { 
     
    520755  } 
    521756   
     757  /** 
     758   * Finds a relation between two classes by introspection 
     759   */ 
    522760  protected function findRelation($phpName, $peerClass) 
    523761  { 
     
    527765  /** 
    528766   * Behavior-like supplementary getter for supplementary columns added by way of withColumn() 
     767   * 
     768   * @param Doctrine_Record $object Doctrine model object 
     769   * @param string $alias Supplementary column name 
     770   * 
     771   * @return mixed The value of the column set by setColumn() 
    529772   */ 
    530773  public function getColumn($object, $alias) 
     
    532775    throw new Exception('This method is not yet implemented'); 
    533776  } 
    534  
     777   
     778  /** 
     779   * Behavior-like supplementary setter for supplementary columns added by way of withColumn() 
     780   * 
     781   * @param Doctrine_Record $object Doctrine model object 
     782   * @param string $alias Supplementary column name 
     783   * @param mixed The value of the column 
     784   */ 
    535785  public function setColumn($object, $alias, $value) 
    536786  { 
  • plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php

    r10664 r10666  
    145145  // Finder Executers 
    146146   
     147  /** 
     148   * Returns the number of records matching the finder 
     149   * 
     150   * @param Boolean $distinct Whether the count query has to add a DISTINCT keyword 
     151   * 
     152   * @return integer Number of records matching the finder 
     153   */ 
    147154  public function count($distinct = false) 
    148155  { 
     
    153160  } 
    154161   
     162  /** 
     163   * Executes the finder and returns the matching Propel objects 
     164   * 
     165   * @param integer $limit Optional maximum number of results to retrieve 
     166   * 
     167   * @return array A list of BaseObject Propel objects 
     168   */ 
    155169  public function find($limit = null) 
    156170  { 
     
    165179  } 
    166180   
     181  /** 
     182   * Limits the search to a single result, and executes the finder 
     183   * Returns the first Propel object matching the finder 
     184   * 
     185   * @return mixed a BaseObject object or null 
     186   */ 
    167187  public function findOne() 
    168188  { 
     
    174194  } 
    175195   
    176   public function findLast($column = null) 
    177   { 
    178     if($column) 
    179     { 
    180       $this->orderBy($column, 'desc'); 
     196  /** 
     197   * Returns the last record matching the finder 
     198   * Optionally, you can specify the column to sort on 
     199   * If no column is passed, the finder guesses the column to use 
     200   * @see guessOrder() 
     201   * 
     202   * @param string $columnName Optional: The column to order by 
     203   * 
     204   * @return mixed a BaseObject object or null 
     205   */ 
     206  public function findLast($columnName = null) 
     207  { 
     208    if($columnName) 
     209    { 
     210      $this->orderBy($columnName, 'desc'); 
    181211    } 
    182212    else 
     
    188218  } 
    189219   
    190   public function findFirst($column = null) 
    191   { 
    192     if($column) 
    193     { 
    194       $this->orderBy($column, 'asc'); 
     220  /** 
     221   * Returns the first record matching the finder 
     222   * Optionally, you can specify the column to sort on 
     223   * If no column is passed, the finder guesses the column to use 
     224   * @see guessOrder() 
     225   * 
     226   * @param string $columnName Optional: The column to order by 
     227   * 
     228   * @return mixed a BaseObject object or null 
     229   */ 
     230  public function findFirst($columnName = null) 
     231  { 
     232    if($columnName) 
     233    { 
     234      $this->orderBy($columnName, 'asc'); 
    195235    } 
    196236    else 
     
    202242  } 
    203243   
     244  /** 
     245   * Adds a condition on a column and returns the records matching the finder 
     246   * 
     247   * @param string $columnName Name of the columns 
     248   * @param mixed $value 
     249   * @param integer $limit Optional maximum number of records to return 
     250   * 
     251   * @return array A list of BaseObject Propel objects 
     252   */ 
    204253  public function findBy($columnName, $value, $limit = null) 
    205254  { 
     
    209258    return $this->find($limit); 
    210259  } 
    211  
     260   
     261  /** 
     262   * Adds a condition on a column and returns the first record matching the finder 
     263   * Useful to retrieve objects by a column which is not the primary key 
     264   * 
     265   * @param string $columnName Name of the columns 
     266   * @param mixed $value 
     267   * 
     268   * @return mixed a BaseObject object or null 
     269   */ 
    212270  public function findOneBy($columnName, $value) 
    213271  { 
     
    218276  } 
    219277   
     278  /** 
     279   * Finds record(s) based on one or several primary keys 
     280   * Takes into account hydrating methods previously called on the finder 
     281   * 
     282   * @param mixed $pk A primary kay, a composite primary key, or an array of primary keys 
     283   * 
     284   * @return mixed One or several BaseObject records (based on the input) 
     285   */ 
    220286  public function findPk($pk) 
    221287  { 
     
    300366  } 
    301367   
     368  /** 
     369   * Prepares a pager based on the finder 
     370   * The pager is initialized (it knows how many pages it contains) 
     371   * But it won't be populated until you call getResults() on it 
     372   * 
     373   * @param integer $page The current page (1 by default) 
     374   * @param integer $maxPerPage The maximum number of results per page (10 by default) 
     375   * 
     376   * @return sfPropelFinderPager The initialized pager object 
     377   */ 
    302378  public function paginate($page = 1, $maxPerPage = 10) 
    303379  { 
     
    367443  } 
    368444   
     445  /** 
     446   * Cleans up the query object (if necessary) and logs the latest query 
     447   * 
     448   * @return sfPropelFinder the current finder object 
     449   */ 
    369450  protected function cleanup() 
    370451  { 
     
    378459  } 
    379460   
     461  /** 
     462   * Finalizes the query, executes it and hydrates results 
     463   *  
     464   * @return array List of Propel objects 
     465   */ 
    380466  public function doFind() 
    381467  { 
     
    571657  // Hydrating 
    572658   
     659  /** 
     660   * Ask the finder to hydrate related records 
     661   * With a single class, it is equivalent to Propel's doSelectJoinXXX() methods 
     662   * But it accepts several arguments, so you can hydrate a lot of related objects 
     663   * Examples: 
     664   *   // Article has an author, article has a category, and author has a group 
     665   *   $articleFinder->with('Author')->find(); 
     666   *   $articleFinder->with('Author', 'Category')->find(); 
     667   *   $articleFinder->with('Author', 'Group')->find(); 
     668   *   $articleFinder->join('Author')->with('Group')->find(); 
     669   *   // By default, the finder uses a simple join (where) but you can force another join 
     670   *   $articleFinder->leftJoin('Author')->with('Author')->find(); 
     671   * 
     672   * @return     sfPropelFinder the current finder object 
     673   */ 
    573674  public function with($classes) 
    574675  { 
     
    592693  } 
    593694   
     695  /** 
     696   * Ask the finder to hydrate related i18n records 
     697   * 
     698   * @param string $culture Optional culture value. If no culture is given, the current user's culture is used 
     699   * 
     700   * @return     sfPropelFinder the current finder object 
     701   */ 
    594702  public function withI18n($culture = null) 
    595703  { 
     
    602710  } 
    603711 
     712  /** 
     713   * Ask the finder to hydrate related columns 
     714   * Columns hydrated by way of withColumn() can be retrieved on the object via getColumn() 
     715   * If the join was not explicitly declared earlier in the finder, it guesses it 
     716   * Examples: 
     717   *   $article = $articleFinder->join('Author')->withColumn('Author.Name')->findOne(); 
     718   *   // The join() can be omitted, in which case the finder will try to guess the join based on the schema 
     719   *   $article = $articleFinder->withColumn('Author.Name')->findOne(); 
     720   *   // Columns added by way of withColumn() can be retrieved by getColumn() 
     721   *   $authorName = $article->getColumn('Author.Name'); 
     722   * 
     723   *   // Alias support 
     724   *   $article = $articleFinder->withColumn('Author.Name', 'authorName')->findOne(); 
     725   *   $authorName = $article->getColumn('authorName'); 
     726   * 
     727   *   // type support 
     728   *   $article = $articleFinder->withColumn('Author.Name', 'authorName', 'string')->findOne(); 
     729   *   $authorName = $article->getColumn('authorName'); 
     730   * 
     731   *   // Support for calculated columns 
     732   *   $articles = articleFinder-> 
     733   *     join('Comment')-> 
     734   *     withColumn('COUNT(comment.ID)', 'NbComments')-> 
     735   *     groupBy('Article.Id')-> 
     736   *     find(); 
     737   * 
     738   * @param string $column The column to add. Can be a calculated column 
     739   * @param string $alias Optional alias for column retrieval 
     740   * @param string $type Optional type converter to be sure the retrieved column has the correct type 
     741   * 
     742   * @return     sfPropelFinder the current finder object 
     743   */ 
    604744  public function withColumn($column, $alias = null, $type = null) 
    605745  { 
     
    637777  /** 
    638778   * Finder Fluid Interface for Criteria::setDistinct() 
     779   * 
     780   * @return     sfPropelFinder the current finder object 
    639781   */ 
    640782  public function distinct() 
     
    690832   * 
    691833   * @see     where() 
     834   * @return     sfPropelFinder the current finder object 
    692835   */ 
    693836  public function _and() 
     
    756899   *  
    757900   * @see where() 
     901   * @return     sfPropelFinder the current finder object 
    758902   */ 
    759903  public function combine($conditions, $operator = 'and', $namedCondition = null) 
     
    824968   *   $commentFinder->relatedTo($article) 
    825969   *    => $c->add(CommentPeer::ARTICLE_ID, $article->getId()) 
     970   * 
     971   * @param  BaseObject $object The related object to restrict to 
     972   * @return sfPropelFinder the current finder object 
    826973   */ 
    827974  public function relatedTo($object) 
     
    848995   *   $articlefinder->orderBy('CategoryId', 'desc') 
    849996   *    => $c->addDescendingOrderByColumn(ArticlePeer::CATEGORY_ID) 
    850    */ 
    851   public function orderBy($columnName, $arguments = array()) 
     997   * 
     998   * @param string $columnName The column to order by 
     999   * @param string $order      The sorting order. 'asc' by default, also accepts 'desc' 
     1000   * 
     1001   * @return     sfPropelFinder the current finder object 
     1002   */ 
     1003  public function orderBy($columnName, $order = null) 
    8521004  { 
    8531005    $column = $this->getColName($columnName); 
    854     if(!is_array($arguments)) 
    855     { 
    856       $arguments = func_get_args(); 
    857       array_shift($arguments); 
    858     }  
    859     $order = strtoupper(array_shift($arguments)); 
    8601006    if(!$order) 
    8611007    { 
    8621008      $order = Criteria::ASC; 
     1009    } 
     1010    else 
     1011    { 
     1012      $order = strtoupper($order); 
    8631013    } 
    8641014     
     
    8841034   *   $articleFinder->groupBy('CreatedAt') 
    8851035   *    => $c->addGroupByColumn(ArticlePeer::CREATED_AT) 
     1036   * 
     1037   * @param string $columnName The column to group by 
     1038   * 
     1039   * @return     sfPropelFinder the current finder object 
    8861040   */ 
    8871041  public function groupBy($columnName) 
     
    9001054   * @param string $class 
    9011055   * 
    902    * @return sfPropelFinder 
     1056   * @return sfPropelFinder the current finder object 
    9031057   */ 
    9041058  public function groupByClass($class) 
     
    9221076   * @param string $direction 'desc' (default) or 'asc' 
    9231077   * 
    924    * @return sfPropelFinder $this the current finder object 
     1078   * @return sfPropelFinder the current finder object 
    9251079   */ 
    9261080  public function guessOrder($direction = 'desc') 
     
    9541108   *   $articleFinder->join('Article.CategoryId', 'Category.Id', 'RIGHT JOIN') 
    9551109   *    => $c->addJoin(ArticlePeer::CATEGORY_ID, CategoryPeer::ID, Criteria::RIGHT_JOIN) 
     1110   *  
     1111   * @param  string $classOrColumn Class to join if 1 argument, first column of the join otherwise 
     1112   * @param  string $column Second column of the join if more than 1 argument 
     1113   * @param  string $joinType Accepted values are null, 'left join', 'right join', 'inner join' 
     1114   * 
     1115   * @return     sfPropelFinder the current finder object 
    9561116   */ 
    9571117  public function join() 
     
    9941154  } 
    9951155   
     1156  /** 
     1157   * Do no reinitialize the finder object after a termination method 
     1158   * By default the Criteria is wiped off whenever a termination method is called 
     1159   * Calling this method with true as parameter will keep the internal Criteria intact for the next termination method 
     1160   * 
     1161   * @param  Boolean $keep true (default) or false 
     1162   * 
     1163   * @return sfPropelFinder the current finder object 
     1164   */ 
    9961165  public function keepQuery($keep = true) 
    9971166  { 
     
    10061175  } 
    10071176   
     1177  /** 
     1178   * Guess the relation to another class 
     1179   * 
     1180   * @param string $phpName Propel Class name (e.g. 'Article') 
     1181   *  
     1182   * @return array A list with the two columns member of the relationship 
     1183   */ 
    10081184  public function getRelation($phpName) 
    10091185  { 
     
    10261202  } 
    10271203   
     1204  /** 
     1205   * Finds a relation between two classes by introspection 
     1206   */ 
    10281207  protected function findRelation($phpName, $peerClass) 
    10291208  { 
     
    10651244   * Behavior-like supplementary getter for supplementary columns added by way of withColumn() 
    10661245   * Requires symfony and sfMixer enabled 
     1246   * 
     1247   * @param BaseObject $object Propel object 
     1248   * @param string $alias Supplementary column name 
     1249   * 
     1250   * @return mixed The value of the column set by setColumn() 
    10671251   */ 
    10681252  public function getColumn($object, $alias) 
    10691253  { 
    10701254    $alias = 'a'.md5($alias); 
     1255     
    10711256    return $object->$alias; 
    10721257  } 
    10731258 
     1259  /** 
     1260   * Behavior-like supplementary setter for supplementary columns added by way of withColumn() 
     1261   * Requires symfony and sfMixer enabled 
     1262   * 
     1263   * @param BaseObject $object Propel object 
     1264   * @param string $alias Supplementary column name 
     1265   * @param mixed The value of the column 
     1266   */ 
    10741267  public function setColumn($object, $alias, $value) 
    10751268  { 
     
    10781271  } 
    10791272   
     1273  /** 
     1274   * Makes an empty Criteria match all records 
     1275   * Some Propel Methods (like doDelete()) need a Criteria with at least one condition to execute 
     1276   * To match all records, this methods adds a condition which is always true 
     1277   *  
     1278   * @param Criteria $c The Criteria object to make true 
     1279   * 
     1280   * @return Criteria A true Criteria 
     1281   */ 
    10801282  protected function addTrueCondition(Criteria $c) 
    10811283  { 
     
    11531355    if(strpos($name, 'orderBy') === 0) 
    11541356    { 
    1155       return $this->orderBy(substr($name, 7), $arguments); 
     1357      array_unshift($arguments, substr($name, 7)); 
     1358      return call_user_func_array(array($this, 'orderBy'), $arguments); 
    11561359    } 
    11571360    if(strpos($name, 'groupBy') === 0) 
    11581361    { 
    1159       return $this->groupBy(substr($name, 7), $arguments); 
     1362      array_unshift($arguments, substr($name, 7)); 
     1363      return call_user_func_array(array($this, 'groupBy'), $arguments); 
    11601364    } 
    11611365    if(strpos($name, 'join') === 0) 
    11621366    { 
    1163       return $this->join(substr($name, 4), $arguments); 
     1367      array_unshift($arguments, substr($name, 4)); 
     1368      return call_user_func_array(array($this, 'join'), $arguments); 
     1369       
    11641370    } 
    11651371    if(($pos = strpos($name, 'Join')) > 0)