Development

Changeset 6072

You must first sign up to be able to contribute.

Changeset 6072

Show
Ignore:
Timestamp:
11/16/07 17:25:46 (1 year ago)
Author:
fabien
Message:

fixed sfMixer hooks in SfPeerBuilder?

Files:

Legend:

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

    r5853 r6072  
    129129      \$culture = sfContext::getInstance()->getUser()->getCulture(); 
    130130    } 
    131  
     131"; 
     132 
     133    if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) 
     134    { 
     135      $script .= " 
     136 
     137    foreach (sfMixer::getCallables('{$this->getClassname()}:doSelectJoin:doSelectJoin') as \$callable) 
     138    { 
     139      call_user_func(\$callable, '{$this->getClassname()}', \$c, \$con); 
     140    } 
     141 
     142"; 
     143    } 
     144 
     145    $script .= " 
    132146    // Set the correct dbName if it has not been overridden 
    133147    if (\$c->getDbName() == Propel::getDefaultDB()) 
     
    221235 
    222236"; 
     237      $tmp = preg_replace('/public static function doSelect(RS|Join.*)\(Criteria \$(c|criteria), \$con = null\)\n\s*{/', '\0'.$mixer_script, $tmp); 
     238    } 
     239 
     240    $script .= $tmp; 
     241  } 
     242 
     243  protected function addDoSelectJoin(&$script) 
     244  { 
     245    $tmp = ''; 
     246    parent::addDoSelectJoin($tmp); 
     247 
     248    if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) 
     249    { 
     250      $mixer_script = " 
     251 
     252    foreach (sfMixer::getCallables('{$this->getClassname()}:doSelectJoin:doSelectJoin') as \$callable) 
     253    { 
     254      call_user_func(\$callable, '{$this->getClassname()}', \$c, \$con); 
     255    } 
     256 
     257"; 
    223258      $tmp = preg_replace('/public static function doSelectJoin.*\(Criteria \$c, \$con = null\)\n\s*{/', '\0'.$mixer_script, $tmp); 
    224259    } 
     
    227262  } 
    228263 
    229   protected function addDoSelectJoin(&$script) 
    230   { 
    231     $tmp = ''; 
    232     parent::addDoSelectJoin($tmp); 
     264  protected function addDoSelectJoinAll(&$script) 
     265  { 
     266    $tmp = ''; 
     267    parent::addDoSelectJoinAll($tmp); 
    233268 
    234269    if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) 
     
    236271      $mixer_script = " 
    237272 
    238     foreach (sfMixer::getCallables('{$this->getClassname()}:doSelectJoin:doSelectJoin') as \$callable) 
     273    foreach (sfMixer::getCallables('{$this->getClassname()}:doSelectJoinAll:doSelectJoinAll') as \$callable) 
    239274    { 
    240275      call_user_func(\$callable, '{$this->getClassname()}', \$c, \$con); 
     
    242277 
    243278"; 
    244       $tmp = preg_replace('/{/', '{'.$mixer_script, $tmp, 1); 
    245     } 
    246  
    247     $script .= $tmp; 
    248   } 
    249  
    250   protected function addDoSelectJoinAll(&$script) 
    251   { 
    252     $tmp = ''; 
    253     parent::addDoSelectJoinAll($tmp); 
    254  
    255     if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) 
    256     { 
    257       $mixer_script = " 
    258  
    259     foreach (sfMixer::getCallables('{$this->getClassname()}:doSelectJoinAll:doSelectJoinAll') as \$callable) 
    260     { 
    261       call_user_func(\$callable, '{$this->getClassname()}', \$c, \$con); 
    262     } 
    263  
    264 "; 
    265       $tmp = preg_replace('/public static function doSelectJoinAllExcept.*\(Criteria \$c, \$con = null\)\n\s*{/', '\0'.$mixer_script, $tmp); 
     279      $tmp = preg_replace('/public static function doSelectJoinAll\(Criteria \$c, \$con = null\)\n\s*{/', '\0'.$mixer_script, $tmp); 
    266280    } 
    267281 
     
    284298 
    285299"; 
    286       $tmp = preg_replace('/{/', '{'.$mixer_script, $tmp, 1); 
     300      $tmp = preg_replace('/public static function doSelectJoinAllExcept.*\(Criteria \$c, \$con = null\)\n\s*{/', '\0'.$mixer_script, $tmp); 
    287301    } 
    288302