Development

Changeset 5761

You must first sign up to be able to contribute.

Changeset 5761

Show
Ignore:
Timestamp:
10/30/07 12:00:05 (10 months ago)
Author:
fabien
Message:

sfPropelPlugin: added a getI18nModel() static method to the Peer builder

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/plugins/sfPropelPlugin/lib/propel/builder/SfPeerBuilder.php

    r3663 r5761  
    4646    { 
    4747      $this->addDoSelectWithI18n($script); 
    48     } 
     48      $this->addI18nMethods($script); 
     49    } 
     50  } 
     51 
     52  protected function addI18nMethods(&$script) 
     53  { 
     54    $table = $this->getTable(); 
     55    foreach ($table->getReferrers() as $fk) 
     56    { 
     57      $tblFK = $fk->getTable(); 
     58      if ($tblFK->getName() == $table->getAttribute('i18nTable')) 
     59      { 
     60        $i18nClassName = $tblFK->getPhpName(); 
     61        break; 
     62      } 
     63    } 
     64 
     65    $script .= " 
     66 
     67  /** 
     68   * Returns the i18n model class name. 
     69   * 
     70   * @return string The i18n model class name 
     71   */ 
     72  public static function getI18nModel() 
     73  { 
     74    return '$i18nClassName'; 
     75  } 
     76"; 
    4977  } 
    5078