Development

Changeset 6122

You must first sign up to be able to contribute.

Changeset 6122

Show
Ignore:
Timestamp:
11/20/07 19:09:16 (1 year ago)
Author:
dwhittle
Message:

dwhittle: merge trunk (forms!) + propel changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/data/data/exception.php

    r4946 r6122  
    5252  <p id="footer"> 
    5353    symfony v.<?php echo sfCore::VERSION ?> - php <?php echo PHP_VERSION ?><br /> 
    54     for help resolving this issue, please visit <a href="http://www.symfony-project.com/">http://www.symfony-project.com/</a>. 
     54    for help resolving this issue, please visit <a href="http://www.symfony-project.org/">http://www.symfony-project.org/</a>. 
    5555  </p> 
    5656  </div></center> 
  • branches/dwhittle/data/modules/default/templates/defaultLayout.php

    r5550 r6122  
    1818<body> 
    1919<div class="sfTContainer"> 
    20   <?php echo link_to(image_tag('/sf/sf_default/images/sfTLogo.png', array('alt' => 'symfony PHP Framework', 'class' => 'sfTLogo', 'size' => '186x39')), 'http://www.symfony-project.com/') ?> 
     20  <?php echo link_to(image_tag('/sf/sf_default/images/sfTLogo.png', array('alt' => 'symfony PHP Framework', 'class' => 'sfTLogo', 'size' => '186x39')), 'http://www.symfony-project.org/') ?> 
    2121  <?php echo (sfConfig::get('escaping_strategy') !== false) ? $sf_data->getRaw('sf_content') : $sf_content; ?> 
    2222</div> 
  • branches/dwhittle/data/modules/default/templates/indexSuccess.php

    r3328 r6122  
    2020      <li class="sfTDatabaseMessage">Create your data model</li> 
    2121      <li class="sfTColorMessage">Customize the layout of the generated templates</li> 
    22       <li class="sfTLinkMessage"><?php echo link_to('Learn more from the online documentation', 'http://www.symfony-project.com/content/documentation.html') ?></li> 
     22      <li class="sfTLinkMessage"><?php echo link_to('Learn more from the online documentation', 'http://www.symfony-project.org/doc') ?></li> 
    2323    </ul> 
    2424  </dd> 
  • branches/dwhittle/data/modules/default/templates/moduleSuccess.php

    r3328 r6122  
    1818      <li class="sfTEditMessage">In <code>actions/actions.class.php</code>, edit the <code>executeIndex()</code> method and remove the final <code>forward</code></li> 
    1919      <li class="sfTColorMessage">Customize the <code>templates/indexSuccess.php</code> template</li> 
    20       <li class="sfTLinkMessage"><?php echo link_to('Learn more from the online documentation', 'http://www.symfony-project.com/content/documentation.html') ?></li> 
     20      <li class="sfTLinkMessage"><?php echo link_to('Learn more from the online documentation', 'http://www.symfony-project.org/doc') ?></li> 
    2121    </ul> 
    2222  </dd> 
  • branches/dwhittle/data/web/errors/error500.php

    r3688 r6122  
    2323<body> 
    2424<div class="sfTContainer"> 
    25   <a title="symfony website" href="http://www.symfony-project.com/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
     25  <a title="symfony website" href="http://www.symfony-project.org/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
    2626  <div class="sfTMessageContainer sfTAlert"> 
    2727    <img alt="page not found" class="sfTMessageIcon" src="<?php echo $path ?>/sf/sf_default/images/icons/tools48.png" height="48" width="48" /> 
  • branches/dwhittle/data/web/errors/unavailable.php

    r3688 r6122  
    2323<body> 
    2424<div class="sfTContainer"> 
    25   <a title="symfony website" href="http://www.symfony-project.com/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
     25  <a title="symfony website" href="http://www.symfony-project.org/"><img alt="symfony PHP Framework" class="sfTLogo" src="<?php echo $path ?>/sf/sf_default/images/sfTLogo.png" height="39" width="186" /></a> 
    2626  <div class="sfTMessageContainer sfTAlert"> 
    2727    <img alt="page not found" class="sfTMessageIcon" src="<?php echo $path ?>/sf/sf_default/images/icons/tools48.png" height="48" width="48" /> 
  • branches/dwhittle/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/projects/bookstore/schema.xml

    r6110 r6122  
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> 
     2<database name="bookstore" defaultIdMethod="native"> 
     3 
     4  <table name="book" description="Book Table"> 
     5    <column name="id" required="true" primaryKey="true" 
     6      autoIncrement="true" type="INTEGER" description="Book Id" /> 
     7    <column name="title" type="VARCHAR" required="true" size="255" 
     8      description="Book Title" /> 
     9    <column name="isbn" required="true" type="VARCHAR" size="24" 
     10      phpName="ISBN" description="ISBN Number" /> 
     11    <column name="price" required="false" type="FLOAT" 
     12      description="Price of the book." /> 
     13    <column name="publisher_id" required="false" type="INTEGER" 
     14      description="Foreign Key Publisher" /> 
     15    <column name="author_id" required="false" type="INTEGER" 
     16      description="Foreign Key Author" /> 
     17    <foreign-key foreignTable="publisher" onDelete="SETNULL"> 
     18      <reference local="publisher_id" foreign="id" /> 
     19    </foreign-key> 
     20    <foreign-key foreignTable="author" onDelete="SETNULL"> 
     21      <reference local="author_id" foreign="id" /> 
     22    </foreign-key> 
     23    <validator column="title" translate="none"> 
     24      <rule name="unique" 
     25        message="Book title already in database." /> 
     26      <rule name="minLength" value="10" 
     27        message="Book title must be more than ${value} characters long." /> 
     28      <rule name="maxLength" value="255" 
     29        message="Book title must not be longer than ${value} characters." /> 
     30    </validator> 
     31    <validator column="isbn" translate="none"> 
     32      <rule name="notMatch" value="/[^\d-]+/" 
     33        message="The ISBN contains invalid characters." /> 
     34    </validator> 
     35  </table> 
     36 
     37  <table name="publisher" description="Publisher Table"> 
     38    <column name="id" required="true" primaryKey="true" 
     39      autoIncrement="true" type="INTEGER" description="Publisher Id" /> 
     40    <column name="name" required="true" type="VARCHAR" size="128" 
     41      default="Penguin" description="Publisher Name" /> 
     42  </table> 
     43 
     44  <table name="author" description="Author Table"> 
     45    <column name="id" required="true" primaryKey="true" 
     46      autoIncrement="true" type="INTEGER" description="Author Id" /> 
     47    <column name="first_name" required="true" type="VARCHAR" 
     48      size="128" description="First Name" /> 
     49    <column name="last_name" required="true" type="VARCHAR" 
     50      size="128" description="Last Name" /> 
     51    <column name="email" type="VARCHAR" size="128" 
     52      description="E-Mail Address" /> 
     53    <column name="age" type="INTEGER" description="The authors age" /> 
     54    <validator column="last_name" translate="none"> 
     55      <rule name="required" 
     56        message="The last name field is required." /> 
     57    </validator> 
     58    <validator column="email" translate="none"> 
     59      <rule name="match" 
     60        value="/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/" 
     61        message="Please enter a valid email address." /> 
     62    </validator> 
     63    <validator column="age" translate="none"> 
     64      <rule name="minValue" value="0" 
     65        message="Please enter a positive number." /> 
     66      <rule name="maxValue" value="100" 
     67        message="Impressive age! Just kidding, hm?" /> 
     68    </validator> 
     69  </table> 
     70 
     71  <table name="review" description="Book Review"> 
     72    <column name="id" required="true" primaryKey="true" 
     73      autoIncrement="true" type="INTEGER" description="Author Id" /> 
     74    <column name="reviewed_by" required="true" type="VARCHAR" 
     75      size="128" description="Reviewer Name" /> 
     76    <column name="review_date" required="true" type="DATE" 
     77      default="01 Jan 2001" description="Date of Review" /> 
     78    <column name="recommended" required="true" type="BOOLEAN" 
     79      description="Does reviewer recommend book?" /> 
     80    <column name="status" type="VARCHAR" size="8" 
     81      description="The status of this review." /> 
     82    <column name="book_id" required="true" type="INTEGER" 
     83      description="Book ID for this review" /> 
     84    <foreign-key foreignTable="book" onDelete="CASCADE"> 
     85      <reference local="book_id" foreign="id" /> 
     86    </foreign-key> 
     87    <validator column="reviewed_by" translate="none"> 
     88      <rule name="required" 
     89        message="The reviewed by field is required." /> 
     90    </validator> 
     91    <validator column="status" translate="none"> 
     92      <rule name="validValues" value="new|reviewed|archived" 
     93        message="Invalid status. (new, reviewed, archived)" /> 
     94    </validator> 
     95  </table> 
     96 
     97  <!-- This table exists to explore/test the handling of BLOB/CLOB objects. --> 
     98  <table name="media"> 
     99    <column name="id" required="true" primaryKey="true" 
     100      autoIncrement="true" type="INTEGER" description="Media Id" /> 
     101    <column name="cover_image" type="BLOB" lazyLoad="true" 
     102      description="The image of the book cover." /> 
     103    <column name="excerpt" type="CLOB" lazyLoad="true" 
     104      description="An excerpt from the book." /> 
     105    <column name="book_id" required="true" type="INTEGER" 
     106      description="Book ID for this media collection." /> 
     107    <foreign-key foreignTable="book" onDelete="CASCADE"> 
     108      <reference local="book_id" foreign="id" /> 
     109    </foreign-key> 
     110  </table> 
     111 
     112  <!-- this table exists to test the many-to-many --> 
     113  <table name="book_club_list" 
     114    description="Reading list for a book club."> 
     115    <column name="id" required="true" primaryKey="true" 
     116      autoIncrement="true" type="INTEGER" 
     117      description="Unique ID for a school reading list." /> 
     118    <column name="group_leader" required="true" type="VARCHAR" 
     119      size="100" 
     120      description="The name of the teacher in charge of summer reading." /> 
     121    <column name="theme" required="false" type="VARCHAR" size="50" 
     122      description="The theme, if applicable, for the reading list." /> 
     123  </table> 
     124 
     125  <table name="book_x_list" phpName="BookListRel" 
     126    description="Cross-reference table for many-to-many relationship between book rows and book_club_list rows."> 
     127    <column name="book_id" primaryKey="true" type="INTEGER" 
     128      description="Fkey to book.id" /> 
     129    <column name="book_club_list_id" primaryKey="true" 
     130      type="INTEGER" description="Fkey to book_club_list.id" /> 
     131    <foreign-key foreignTable="book" onDelete="CASCADE"> 
     132      <reference local="book_id" foreign="id" /> 
     133    </foreign-key> 
     134    <foreign-key foreignTable="book_club_list" onDelete="CASCADE"> 
     135      <reference local="book_club_list_id" foreign="id" /> 
     136    </foreign-key> 
     137  </table> 
     138 
     139  <!-- test self-referencing foreign keys and inheritance--> 
     140  <table name="bookstore_employee" 
     141    description="Hierarchical table to represent employees of a bookstore."> 
     142    <column name="id" type="INTEGER" primaryKey="true" 
     143      autoIncrement="true" description="Employee ID number" /> 
     144    <column name="class_key" type="INTEGER" required="true" 
     145      default="0" inheritance="single"> 
     146      <inheritance key="0" class="BookstoreEmployee" /> 
     147      <inheritance key="1" class="BookstoreManager" 
     148        extends="BookstoreEmployee" /> 
     149      <inheritance key="2" class="BookstoreCashier" 
     150        extends="BookstoreEmployee" /> 
     151    </column> 
     152    <column name="name" type="VARCHAR" size="32" 
     153      description="Employee name" /> 
     154    <column name="job_title" type="VARCHAR" size="32" 
     155      description="Employee job title" /> 
     156    <column name="supervisor_id" type="INTEGER" 
     157      description="Fkey to supervisor." /> 
     158    <foreign-key foreignTable="bookstore_employee" 
     159      phpName="Supervisor" refPhpName="Subordinate"> 
     160      <reference local="supervisor_id" foreign="id" /> 
     161    </foreign-key> 
     162  </table> 
     163 
     164  <!-- Test one-to-one relationship --> 
     165  <table name="bookstore_employee_account" 
     166    description="A table that represents a bookstore employees login credentials."> 
     167    <column name="employee_id" type="INTEGER" primaryKey="true" 
     168      description="Primary key for the account ..." /> 
     169    <column name="login" type="VARCHAR" size="32" /> 
     170    <column name="password" type="VARCHAR" size="100" 
     171      default="'@''34&quot;" /> 
     172    <column name="enabled" type="BOOLEAN" default="true" /> 
     173    <column name="created" type="TIMESTAMP" 
     174      defaultExpr="CURRENT_TIMESTAMP" /> 
     175    <foreign-key foreignTable="bookstore_employee" 
     176      onDelete="cascade"> 
     177      <reference local="employee_id" foreign="id" /> 
     178    </foreign-key> 
     179    <unique> 
     180      <unique-column name="login" /> 
     181    </unique> 
     182  </table> 
     183 
     184  <!--  book_reader, book_opinion, and reader_favorite test some foreign key issues   
     185    (see: http://propel.phpdb.org/trac/ticket/228) --> 
     186  <table name="book_reader"> 
     187    <column name="id" type="INTEGER" primaryKey="true" 
     188      autoIncrement="true" description="Book reader ID number" /> 
     189    <column name="name" type="VARCHAR" size="50" /> 
     190  </table> 
     191 
     192  <table name="book_opinion"> 
     193    <column name="book_id" type="INTEGER" primaryKey="true" /> 
     194    <column name="reader_id" type="INTEGER" primaryKey="true" /> 
     195    <column name="rating" type="DECIMAL" /> 
     196    <column name="recommend_to_friend" type="BOOLEAN" /> 
     197    <foreign-key foreignTable="book" onDelete="cascade"> 
     198      <reference local="book_id" foreign="id" /> 
     199    </foreign-key> 
     200    <foreign-key foreignTable="book_reader" onDelete="cascade"> 
     201      <reference local="reader_id" foreign="id" /> 
     202    </foreign-key> 
     203  </table> 
     204 
     205  <table name="reader_favorite"><!--  this is just for the sake of testing multiple foreign keys for a single column --> 
     206    <column name="book_id" type="INTEGER" primaryKey="true" /> 
     207    <column name="reader_id" type="INTEGER" primaryKey="true" /> 
     208    <foreign-key foreignTable="book" onDelete="cascade"> 
     209      <reference local="book_id" foreign="id" /> 
     210    </foreign-key> 
     211    <foreign-key foreignTable="book_reader" onDelete="cascade"> 
     212      <reference local="reader_id" foreign="id" /> 
     213    </foreign-key> 
     214    <!--  
     215      <foreign-key foreignTable="book_opinion" onDelete="cascade"> 
     216      <reference local="book_id" foreign="book_id"/> 
     217      <reference local="reader_id" foreign="reader_id"/> 
     218      </foreign-key> 
     219    --> 
     220  </table> 
     221 
     222  <!--  Test some custom php column types. --> 
     223  <table name="bookstore"> 
     224    <column name="id" type="INTEGER" primaryKey="true" 
     225      autoIncrement="true" description="Book store ID number" /> 
     226    <column name="store_name" type="VARCHAR" size="50" 
     227      required="true" /> 
     228    <column name="location" type="VARCHAR" size="100" /> 
     229    <column name="population_served" type="BIGINT" /> 
     230    <column name="total_books" type="INTEGER" /> 
     231    <column name="store_open_time" type="TIME" /> 
     232  </table> 
     233 
     234  <!--  test default values on foreign keys --> 
     235  <table name="bookstore_sale"> 
     236    <column name="id" type="INTEGER" primaryKey="true" 
     237      autoIncrement="true" /> 
     238    <column name="bookstore_id" type="INTEGER" required="false" 
     239      default="1" /> 
     240    <column name="publisher_id" type="INTEGER" required="false" /> 
     241    <column name="sale_name" type="VARCHAR" size="100" 
     242      required="false" /> 
     243    <column name="discount" type="TINYINT" 
     244      description="Discount percentage" /> 
     245    <foreign-key foreignTable="bookstore" onDelete="cascade"> 
     246      <reference local="bookstore_id" foreign="id" /> 
     247    </foreign-key> 
     248    <foreign-key foreignTable="publisher" onDelete="SETNULL"> 
     249      <reference local="publisher_id" foreign="id" /> 
     250    </foreign-key> 
     251  </table> 
     252   
     253  <table name="customer"> 
     254    <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true"/> 
     255    <column name="name" type="VARCHAR" size="255"/> 
     256    <column name="join_date" type="DATE" defaultExpr="CURRENT_DATE"/> 
     257  </table> 
     258   
     259  <table name="contest"> 
     260    <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true"/> 
     261    <column name="name" type="VARCHAR" size="100"/> 
     262  </table> 
     263   
     264  <table name="bookstore_contest"> 
     265    <column name="bookstore_id" type="INTEGER" primaryKey="true"/> 
     266    <column name="contest_id" type="INTEGER" primaryKey="true"/> 
     267    <column name="prize_book_id" type="INTEGER"/> 
     268    <foreign-key foreignTable="bookstore" onDelete="CASCADE"> 
     269      <reference local="bookstore_id" foreign="id" /> 
     270    </foreign-key> 
     271    <foreign-key foreignTable="contest" onDelete="CASCADE"> 
     272      <reference local="contest_id" foreign="id" /> 
     273    </foreign-key> 
     274    <foreign-key foreignTable="book" onDelete="SETNULL"> 
     275      <reference local="prize_book_id" foreign="id" /> 
     276    </foreign-key> 
     277  </table> 
     278 
     279  <table name="bookstore_contest_entry"> 
     280    <column name="bookstore_id" type="INTEGER" primaryKey="true"/> 
     281    <column name="contest_id" type="INTEGER" primaryKey="true"/> 
     282    <column name="customer_id" type="INTEGER" primaryKey="true"/> 
     283    <column name="entry_date" type="TIMESTAMP" defaultExpr="CURRENT_TIMESTAMP"/> 
     284    <foreign-key foreignTable="bookstore" onDelete="CASCADE"> 
     285      <reference local="bookstore_id" foreign="id" /> 
     286    </foreign-key> 
     287    <foreign-key foreignTable="customer" onDelete="CASCADE"> 
     288      <reference local="customer_id" foreign="id" /> 
     289    </foreign-key> 
     290    <foreign-key foreignTable="bookstore_contest" onDelete="CASCADE"> 
     291      <reference local="bookstore_id" foreign="bookstore_id" /> 
     292      <reference local="contest_id" foreign="contest_id" /> 
     293    </foreign-key> 
     294  </table> 
     295 
     296</database> 
  • branches/dwhittle/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/test/classes/propel/util/BasePeerTest.php

    r6110 r6122  
    5959    } 
    6060  } 
     61   
     62  /** 
     63   *  
     64   */ 
     65  public function testBigIntIgnoreCaseOrderBy() 
     66  { 
     67    // Some sample data 
     68    $b = new Bookstore(); 
     69    $b->setStoreName("SortTest1")->setPopulationServed(2000)->save(); 
     70     
     71    $b = new Bookstore(); 
     72    $b->setStoreName("SortTest2")->setPopulationServed(201)->save(); 
     73     
     74    $b = new Bookstore(); 
     75    $b->setStoreName("SortTest3")->setPopulationServed(302)->save(); 
     76     
     77    $b = new Bookstore(); 
     78    $b->setStoreName("SortTest4")->setPopulationServed(10000000)->save(); 
     79     
     80    $c = new Criteria(); 
     81    $c->setIgnoreCase(true); 
     82    $c->add(BookstorePeer::STORE_NAME, 'SortTest%', Criteria::LIKE); 
     83    $c->addAscendingOrderByColumn(BookstorePeer::POPULATION_SERVED); 
     84     
     85    $rows = BookstorePeer::doSelect($c); 
     86    $this->assertEquals('SortTest2', $rows[0]->getStoreName()); 
     87    $this->assertEquals('SortTest3', $rows[1]->getStoreName()); 
     88    $this->assertEquals('SortTest1', $rows[2]->getStoreName()); 
     89    $this->assertEquals('SortTest4', $rows[3]->getStoreName()); 
     90  } 
    6191} 
  • branches/dwhittle/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php

    r5944 r6122  
    11<?php 
    22/* 
    3  *  $Id: Propel.php 797 2007-11-09 19:21:21Z heltem
     3 *  $Id: Propel.php 821 2007-11-20 12:47:17Z hans
    44 * 
    55 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     
    3838 * @author     Henning P. Schmiedehausen <hps@intermeta.de> (Torque) 
    3939 * @author     Kurt Schrader <kschrader@karmalab.org> (Torque) 
    40  * @version    $Revision: 797
     40 * @version    $Revision: 821
    4141 * @package    propel 
    4242 */ 
     
    202202    if (self::$configuration === null) { 
    203203      throw new PropelException("Propel cannot be initialized without " 
    204       . "a valid configuration. Please check the log files " 
    205       . "for further details."); 
     204      . "a valid configuration. Please check the log files " 
     205      . "for further details."); 
    206206    } 
    207207 
     
    407407    return self::$dbMaps[$name]; 
    408408  } 
     409   
     410  /** 
     411   * Sets the database map object to use for specified datasource. 
     412   * 
     413   * @param      string $name The datasource name. 
     414   * @param      DatabaseMap $map The database map object to use for specified datasource.  
     415   */ 
     416  public static function setDatabaseMap($name, DatabaseMap $map) 
     417  { 
     418    if ($name === null) { 
     419      $name = self::getDefaultDB(); 
     420    } 
     421    self::$dbMaps[$name] = $map; 
     422  } 
    409423 
    410424  /** 
     
    480494 
    481495  /** 
     496   * Sets the connection to use for specified datasource. 
     497   * 
     498   * @param      string $name The datasource name. 
     499   * @param      PropelPDO $con The PDO connection object to use for specified datasource.  
     500   */ 
     501  public static function setConnection($name, PropelPDO $con) 
     502  { 
     503    if ($name === null) { 
     504      $name = self::getDefaultDB(); 
     505    } 
     506    self::$connectionMap[$name] = $con; 
     507  } 
     508 
     509  /** 
    482510   * Internal function to handle driver options or conneciton attributes in PDO. 
    483511   * 
     
    515543 
    516544  /** 
    517    * Returns database adapter for a specific connection pool
    518    * 
    519    * @param      string A database name. 
     545   * Returns database adapter for a specific datasource
     546   * 
     547   * @param      string The datasource name. 
    520548   * 
    521549   * @return     DBAdapter The corresponding database adapter. 
     
    542570 
    543571  /** 
     572   * Sets a database adapter for specified datasource. 
     573   * 
     574   * @param      string $name The datasource name. 
     575   * @param      DBAdapter $adapter The DBAdapter implementation to use. 
     576   */ 
     577  public static function setDB($name, DBAdapter $adapter) 
     578  { 
     579    if ($name === null) { 
     580      $name = self::getDefaultDB(); 
     581    } 
     582    self::$adapterMap[$name] = $adapter; 
     583  } 
     584 
     585  /** 
    544586   * Returns the name of the default database. 
    545587   * 
  • branches/dwhittle/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/BasePeer.php

    r5248 r6122  
    11<?php 
    22/* 
    3  *  $Id: BasePeer.php 657 2007-06-20 17:25:02Z hans $ 
     3 *  $Id: BasePeer.php 821 2007-11-20 12:47:17Z hans $ 
    44 * 
    55 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     
    3535 * @author     Brett McLaughlin <bmclaugh@algx.net> (Torque) 
    3636 * @author     Stephen Haberman <stephenh@chase3000.com> (Torque) 
    37  * @version    $Revision: 657
     37 * @version    $Revision: 821
    3838 * @package    propel.util 
    3939 */ 
     
    760760      } 
    761761    } 
    762 /* 
    763         // Old Code. 
    764         $joins =& $criteria->getJoins(); 
    765         if (!empty($joins)) { 
    766           for ($i=0, $joinSize=count($joins); $i < $joinSize; $i++) { 
    767             $join =& $joins[$i]; 
    768             $join1 = $join->getLeftColumn(); 
    769             $join2 = $join->getRightColumn(); 
    770  
    771             $tableName = substr($join1, 0, strpos($join1, '.')); 
    772             $table = $criteria->getTableForAlias($tableName); 
    773             if ($table !== null) { 
    774               $fromClause[] = $table . ' ' . $tableName; 
    775             } else { 
    776               $fromClause[] = $tableName; 
    777             } 
    778  
    779             $dot = strpos($join2, '.'); 
    780             $tableName = substr($join2, 0, $dot); 
    781             $table = $criteria->getTableForAlias($tableName); 
    782             if ($table !== null) { 
    783               $fromClause[] = $table . ' ' . $tableName; 
    784             } else { 
    785               $fromClause[] = $tableName; 
    786               $table = $tableName; 
    787             } 
    788             $ignoreCase = ($criteria->isIgnoreCase() && ($dbMap->getTable($table)->getColumn(substr($join2, $dot + 1))->getType() == "string")); 
    789             if ($ignoreCase) { 
    790               $whereClause[] = $db->ignoreCase($join1) . '=' . $db->ignoreCase($join2); 
    791             } else { 
    792               $whereClause[] = $join1 . '=' . $join2; 
    793             } 
    794           if ($join->getJoinType()) { 
    795               $leftTable = $fromClause[count($fromClause) - 2]; 
    796               $rightTable = $fromClause[count($fromClause) - 1]; 
    797               $onClause = $whereClause[count($whereClause) - 1]; 
    798               unset($whereClause[count($whereClause) - 1]); 
    799               $fromClause [] = $leftTable . ' ' . $join->getJoinType() . ' ' . $rightTable . ' ON ' . $onClause; 
    800  
    801               // remove all references to joinTables made by selectColumns, criteriaColumns 
    802               for ($i = 0, $fromClauseSize=count($fromClause); $i < $fromClauseSize; $i++) { 
    803                 if ($fromClause[$i] == $leftTable || $fromClause[$i] == $rightTable) { 
    804                   unset($fromClause[$i]); 
    805                 } 
    806               } 
    807             } // If join type 
    808           } // Join for loop 
    809         } // If Joins 
    810 */ 
    811762 
    812763    // Add the GROUP BY columns 
     
    866817 
    867818        $column = $tableName ? $dbMap->getTable($tableName)->getColumn($columnName) : null; 
    868  
    869         if ($column && $column->getType() == 'string') { 
     819         
     820        if ($column && $column->isText()) { 
    870821          $orderByClause[] = $db->ignoreCaseInOrderBy("$tableAlias.$columnAlias") . $direction; 
    871822          $selectClause[] = $db->ignoreCaseInOrderBy("$tableAlias.$columnAlias"); 
  • branches/dwhittle/lib/widget/sfWidgetFormInputPassword.class.php

    r5943 r6122  
    2020{ 
    2121  /** 
     22   * Configures the current widget. 
     23   * 
     24   * Available options: 
     25   * 
     26   *  * always_render_empty: true if you want the input value to be always empty when rendering (true by default) 
     27   * 
    2228   * @see sfWidgetFormInput 
    2329   */ 
     
    2632    parent::configure($options, $attributes); 
    2733 
     34    $this->addOption('always_render_empty', true); 
     35 
    2836    $this->setOption('type', 'password'); 
    2937  } 
     38 
     39  /** 
     40   * @see sfWidgetForm 
     41   */ 
     42  public function render($name, $value = null, $attributes = array(), $errors = array()) 
     43  { 
     44    return parent::render($name, $this->getOption('always_render_empty') ? null : $value, $attributes, $errors); 
     45  } 
    3046} 
  • branches/dwhittle/package.xml.tmpl

    r4553 r6122  
    2626  <api>##STABILITY##</api> 
    2727 </stability> 
    28  <license uri="http://www.symfony-project.com/license">MIT license</license> 
     28 <license uri="http://www.symfony-project.org/license">MIT license</license> 
    2929 <notes>-</notes> 
    3030 
  • branches/dwhittle/test/unit/widget/sfWidgetFormInputPasswordTest.php

    r5943 r6122  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(1, new lime_output_color()); 
     13$t = new lime_test(3, new lime_output_color()); 
    1414 
    1515$w = new sfWidgetFormInputPassword(); 
     
    1818$t->diag('->render()'); 
    1919$t->is($w->render('foo'), '<input type="password" name="foo" id="foo" />', '->render() renders the widget as HTML'); 
     20 
     21$t->is($w->render('foo', 'bar'), '<input type="password" name="foo" id="foo" />', '->render() renders the widget as HTML'); 
     22 
     23$w->setOption('always_render_empty', false); 
     24$t->is($w->render('foo', 'bar'), '<input type="password" name="foo" value="bar" id="foo" />', '->render() renders the widget as HTML');