Development

ApplyingCustomJoinsInDoSelect (diff)

You must first sign up to be able to contribute.

Changes between Version 2 and Version 3 of ApplyingCustomJoinsInDoSelect

Show
Ignore:
Author:
tamcy (IP: 219.77.4.200)
Timestamp:
06/12/06 15:57:20 (11 years ago)
Comment:

fix typo (again)

Legend:

Unmodified
Added
Removed
Modified
  • ApplyingCustomJoinsInDoSelect

    v2 v3  
    1 == Doing custom joinings in propel classes == 
     1== Applying custom joins in doSelect* method == 
    22 
    33You want to join a table when running doSelect method to save you from doing multiple queries. If for various reasons you cannot refer it to a foreign key column, you can still write your own {{{doSelectJoin*}}} method like the code generated by Propel. This page describes how to achieve this. 
    1919    // Add select columns for Article 
    2020    ArticlePeer::addSelectColumns($c); 
    21     $startcol = (ArticlePeer::NUM_COLUMNS - ArticlePeer::NUM_LAZY_LOAD_COLUMNS) + 1; 
     21    $startcol2 = (ArticlePeer::NUM_COLUMNS - ArticlePeer::NUM_LAZY_LOAD_COLUMNS) + 1; 
    2222 
    2323    // Add select columns for Book 
    2424    BookPeer::addSelectColumns($c); 
    25     $startcol2 = (BookPeer::NUM_COLUMNS - BookPeer::NUM_LAZY_LOAD_COLUMNS) + $startcol
     25    $startcol3 = $startcol + BookPeer::NUM_COLUMNS
    2626 
    2727    // Add select columns for Category 
    2828    CategoryPeer::addSelectColumns($c); 
    29     $startcol3 = (CategoryPeer::NUM_COLUMNS - CategoryPeer::NUM_LAZY_LOAD_COLUMNS) + $startcol2; 
    3029 
    3130    // [NOTE 1]