Development

Changeset 7468

You must first sign up to be able to contribute.

Changeset 7468

Show
Ignore:
Timestamp:
02/12/08 17:42:39 (2 years ago)
Author:
Leon.van.der.Ree
Message:

Major upgrade of fieldname parsing!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/actions/actions.class.php

    r7414 r7468  
    9696    $this->pager = new sfPropelPager('<?php echo $this->getClassName() ?>', $limit); 
    9797    $c = new Criteria(); 
    98 <?php if ($sortColumn = $this->getGroupField()) :  
    99  
    100     //strange construction!? AND Note there is also something like: $this->getPeerClassName()  
    101     $className = '<?php echo $this->getClassName() ?>'; 
    102  
    103     if (false !== strpos($sortColumn, $tableDelimiter)) 
    104     { 
    105       $elements = explode($tableDelimiter, $sortColumn); 
    106        
    107       $className = sfInflector::camelize($elements[count($elements)-2]); 
    108       $sortColumn = $elements[count($elements)-1];  
     98<?php if ($sortColumnName = $this->getGroupField()) : 
     99    $sortColumnName = str_replace($tableDelimiter, '/', $sortColumnName);  
     100    $sortColumn = $this->getColumnForFieldName($sortColumnName); 
     101     
     102    $className = $this->getClassName(); 
     103    if (false !== strpos($sortColumnName, '/')) 
     104    { 
     105      $className = $sortColumn->getTable()->getPhpName(); 
    109106    } 
    110107 
    111108    try 
    112109    { 
    113       $sortColumn = sfInflector::camelize(strtolower($sortColumn));  
    114       $fieldName = call_user_func(array($className.'Peer', 'translateFieldName'), $sortColumn, BasePeer::TYPE_PHPNAME, BasePeer::TYPE_COLNAME); 
     110      $fieldName = call_user_func(array($className.'Peer', 'translateFieldName'), $sortColumn->getPhpName(), BasePeer::TYPE_PHPNAME, BasePeer::TYPE_COLNAME); 
    115111    } 
    116112    catch (Exception $e) 
     
    431427   
    432428    $columnName = $column->key;   
    433     list($class, $checkName) = explode('/',$columnName, 2); 
     429    //list($class, $checkName) = explode('/',$columnName, 2); //TODO: not always two columns!!! class obsolete 
    434430    
    435     if (strtolower($class) != strtolower($tableName)) 
    436     { 
    437       $checkName = $columnName; 
    438     } 
     431//    if (strtolower($class) != strtolower($tableName)) 
     432//    { 
     433//      $checkName = $columnName; 
     434//    } 
    439435     
    440436    if ($column->isPrimaryKey()) continue; 
    441     if (false !== strpos($checkName, '/')) continue; // TODO: at the moment cannot handle foreign fields  
     437    if (false !== strpos($columnName, '/')) continue; // TODO: at the moment cannot handle foreign fields  
    442438     
    443439    $type = $column->getCreoleType();  
     
    445441    <?php echo !$first ? 'else' : '' ?>if ($columnName == '<?php echo str_replace('/', $tableDelimiter, $column->key) ?>') 
    446442    { 
    447 <?php $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials') ?> 
     443<?php $credentials = $this->getParameterValue('list.fields.'.$columnName.'.credentials') ?> 
    448444<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
    449445    if ($this->getUser()->hasCredential(<?php echo $credentials ?>)) 
     
    503499  protected function update<?php echo $this->getClassName() ?>FromRequest() 
    504500  { 
    505     $<?php echo $this->getSingularName() ?> = $this->getRequestParameter('<?php echo $this->getSingularName() ?>'); 
     501    $<?php echo $this->getSingularName() ?> = $this->getRequestParameter('<?php echo $this->getTableName() ?>'); 
    506502 
    507503<?php  
     
    511507 
    512508  foreach ($columns as $column):  
    513     list($class, $checkName) = explode('/', $column->key, 2); 
     509//    list($class, $checkName) = explode('/', $column->key, 2); 
    514510      
    515     if (strtolower($class) != strtolower($tableName)) 
    516     { 
    517       $checkName = $columnName; 
    518     } 
     511//    if (strtolower($class) != strtolower($tableName)) 
     512//    { 
     513//      $checkName = $columnName; 
     514//    } 
    519515     
    520516    if ($column->isPrimaryKey()) continue; 
    521     if (false !== strpos($checkName, '/')) continue; // TODO: at the moment cannot handle foreign fields  
     517    if (false !== strpos($columnName, '/')) continue; // TODO: at the moment cannot handle foreign fields  
    522518 
    523519    $type = $column->getCreoleType(); 
    524     $name = str_replace('/', $tableDelimiter, $checkName); 
    525  
    526     $credentials = $this->getParameterValue('edit.fields.'.$checkName.'.credentials'); 
    527     $input_type = $this->getParameterValue('edit.fields.'.$checkName.'.type'); 
     520    $name = str_replace('/', $tableDelimiter, $columnName); 
     521 
     522    $credentials = $this->getParameterValue('edit.fields.'.$columnName.'.credentials'); 
     523    $input_type = $this->getParameterValue('edit.fields.'.$columnName.'.type'); 
    528524     
    529525?> 
     
    536532<?php endif; ?> 
    537533<?php if ($input_type == 'admin_input_file_tag'): ?> 
    538 <?php $upload_dir = $this->replaceConstants($this->getParameterValue('edit.fields.'.$checkName.'.upload_dir')) ?> 
     534<?php $upload_dir = $this->replaceConstants($this->getParameterValue('edit.fields.'.$columnName.'.upload_dir')) ?> 
    539535    $currentFile = sfConfig::get('sf_upload_dir')."/<?php echo $upload_dir ?>/".$this-><?php echo $this->getSingularName() ?>->get<?php echo $column->getPhpName() ?>(); 
    540536    if (!$this->getRequest()->hasErrors() && isset($<?php echo $this->getSingularName() ?>['<?php echo $name ?>_remove'])) 
     
    554550<?php endif; ?> 
    555551<?php if ($input_type == 'admin_input_file_tag'): ?> 
    556 <?php if ($this->getParameterValue('edit.fields.'.$checkName.'.filename')): ?> 
    557       $fileName = "<?php echo str_replace('"', '\\"', $this->replaceConstants($this->getParameterValue('edit.fields.'.$checkName.'.filename'))) ?>"; 
     552<?php if ($this->getParameterValue('edit.fields.'.$columnName.'.filename')): ?> 
     553      $fileName = "<?php echo str_replace('"', '\\"', $this->replaceConstants($this->getParameterValue('edit.fields.'.$columnName.'.filename'))) ?>"; 
    558554<?php else: ?> 
    559555      $fileName = md5($this->getRequest()->getFileName('<?php echo $this->getSingularName() ?>[<?php echo $name ?>]').time().rand(0, 99999)); 
     
    635631<?php if ($this->getParameterValue('list.filters')): ?> 
    636632<?php foreach ($this->getColumns('list.filters') as $column): $type = $column->getCreoleType() ?> 
    637 <?php if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): //TODO replace $column->getName with $checkName ?> 
     633<?php if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): //TODO replace $column->getName with $columnName ?> 
    638634      if (isset($filters['<?php echo $column->getName() ?>']['from']) && $filters['<?php echo $column->getName() ?>']['from'] !== '') 
    639635      { 
     
    696692    if (!$this->getUser()->getAttributeHolder()->getAll('sf_admin/<?php echo $this->getSingularName() ?>/sort')) 
    697693    { 
    698 //<?php $mainclassPrefix = "" ?> 
    699 //<?php if ($this->getParameterValue('sub_class.model_class')) $mainclassPrefix = $this->getSingularName()."_"; ?> 
    700  
    701694<?php if ($sort = $this->getParameterValue('list.sort')): ?> 
    702695 
     
    731724  $groupedColumns = $this->getColumnsGrouped($for, false); 
    732725   
    733   $pk = clone($groupedColumns['pk']); //copy by value, you don't want to add $pk->key to groupedColumns['pk'] 
    734   $pk->key = strtolower($pk->getTableName().'/'.$pk->getName()); 
     726  $pk = clone($groupedColumns['pk']); //OBSOLETE copy by value, you don't want to add $pk->key to groupedColumns['pk'] 
     727  $pk->key = strtolower($pk->getName()); // $pk->getTableName().'/'. 
    735728   
    736729  $columns = array(); 
     
    740733  { 
    741734    $pkr = clone($relatedGroupedColumns['pk']); //copy by value, you don't want to add $pk->key to groupedColumns['pk'] 
    742     $pkr->key = strtolower($pk->getTableName().'/'.$pkr->getTableName().'/'.$pkr->getName()); 
     735    $pkr->key = strtolower($pkr->getTableName().'/'.$pkr->getName()); // $pk->getTableName().'/'. 
    743736     
    744737    $columns[] = $pkr; // add related primary key 
     
    754747  if (false !== strpos($column->key, '/')) 
    755748  { 
    756     $parts = explode('/', $column->key); 
    757     $peer = $parts[count($parts)-2]; 
    758     $peerClassName = sfInflector::camelize($peer).'Peer'; 
     749    $peerClassName = sfInflector::camelize($column->getTable()->getPhpName()).'Peer'; 
    759750  } 
    760751  $columnName = strtoupper($column->getName()); 
     
    837828      foreach($sort_array as $sort_column => $sort_type) 
    838829      { 
    839         //strange construction!? AND Note there is also something like: $this->getPeerClassName()  
     830        $fields = explode($tableDelimiter, $sort_column); 
     831          
     832        //get className 
    840833        $className = '<?php echo $this->getClassName() ?>'; 
    841  
    842         //fix for cookie error 
    843         $sortColumn = $sort_column; 
    844         if (false !== strpos($sort_column, $tableDelimiter)) 
    845         { 
    846           $elements = explode($tableDelimiter, $sort_column); 
    847           $className = $elements[count($elements)-2]; 
    848           $sortColumn = $elements[count($elements)-1];  
    849           $className = sfInflector::camelize($className); 
    850         } 
    851         //$sortColumn = str_replace(sfInflector::underscore($className).$tableDelimiter, '', $sort_column); 
    852  
     834        for ($i = 0; $i < count($fields) -1; $i++) 
     835        { 
     836          $map = call_user_func(array($className.'Peer', 'getTableMap')); 
     837          $columns = $map->getColumns(); 
     838          $found = false; 
     839          foreach ($columns as $column)  
     840          { 
     841            if ($column->getColumnName() == strtoupper($fields[$i]))  
     842            { 
     843              $found = true; 
     844              break; 
     845            } 
     846          } 
     847           
     848          if (!$found) 
     849          { 
     850            throw new Exception('Sort column "'.$sort_column.'" not found'); 
     851          } 
     852 
     853          $className = $this->translateTableNameToPhpName($column->getRelatedTableName()); 
     854        } 
     855         
     856        //get sortColumn 
     857        $map = call_user_func(array($className.'Peer', 'getTableMap')); 
     858        $columns = $map->getColumns(); 
     859        $found = false; 
     860        foreach ($columns as $column)  
     861        { 
     862          if ($column->getColumnName() == strtoupper($fields[$i]))  
     863          { 
     864            $found = true; 
     865            break; 
     866          } 
     867        } 
     868         
     869        if (!$found) 
     870        { 
     871          throw new Exception('Sort column "'.$sort_column.'" not found'); 
     872        } 
     873       
    853874        try 
    854875        { 
    855           // removed strtoupper 
    856           $sortColumn = sfInflector::camelize(strtolower($sortColumn));  
    857           $fieldName = call_user_func(array($className.'Peer', 'translateFieldName'), $sortColumn, BasePeer::TYPE_PHPNAME, BasePeer::TYPE_COLNAME); 
     876          $fieldName = call_user_func(array($className.'Peer', 'translateFieldName'), $column->getPhpName(), BasePeer::TYPE_PHPNAME, BasePeer::TYPE_COLNAME); 
    858877          $sort_columns[$fieldName] = $sort_type; 
    859878        } 
     
    898917    $columnName = $column->key; 
    899918 
    900     list($class, $checkName) = explode('/', $columnName, 2); 
    901       
    902     if (strtolower($class) != strtolower($tableName)) 
    903     { 
    904       $class = strtolower($tableName); 
    905       $checkName = $columnName; 
    906     }      
     919//    list($class, $checkName) = explode('/', $columnName, 2); 
     920//      
     921//    if (strtolower($class) != strtolower($tableName)) 
     922//    { 
     923//      $class = strtolower($tableName); 
     924//      $checkName = $columnName; 
     925//    }      
    907926     
    908927    $fieldName = str_replace('/', $tableDelimiter, $columnName); 
    909928     
    910     $labelName = str_replace("'", "\\'", $this->getParameterValue('edit.fields.'.$checkName.'.name')); 
     929    $labelName = str_replace("'", "\\'", $this->getParameterValue('edit.fields.'.$columnName.'.name')); 
    911930?> 
    912931      '<?php echo $fieldName ?>' => '<?php echo $labelName ?>', 
     
    914933    ); 
    915934  } 
     935 
     936 
     937  protected function translateTableNameToPhpName($tableName) 
     938  { 
     939    switch($tableName) 
     940    { 
     941<?php  
     942  $groupedColumns = $this->getColumnsGrouped(array('list.display', 'edit.display')); 
     943  foreach ($groupedColumns['related'] as $relatedTableName => $relatedTable):  
     944?> 
     945      case '<?php echo $relatedTableName ?>': 
     946        return '<?php echo $relatedTable['pk']->getTable()->getPhpName(); ?>'; 
     947<?php endforeach; ?> 
     948    } 
     949     
     950    throw new Exception('Unknown table name: "'.$tableName.'"'); 
     951  } 
     952 
    916953   
    917954  public function executeListJs() 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__ajax_store.php

    r7164 r7468  
    3838$columns = $this->getListUniqueColumns($groupedColumns, true); 
    3939$pkn = $groupedColumns['pk']->getName(); 
     40$tableName = $groupedColumns['pk']->getTableName(); 
    4041 
    4142 
     
    5657        foreach ($columns as $columnName => $column) 
    5758        { 
    58           $columnName = $column->key; 
    59  
    60           list($class, $checkName) = explode('/', $columnName, 2); 
    61             
    62           if (strtolower($class) != strtolower($tableName)) 
    63           { 
    64             $class = $tableName; 
    65             $checkName = $columnName; 
    66           }      
     59//          $columnName = $column->key; 
     60// 
     61//          list($class, $checkName) = explode('/', $columnName, 2); 
     62//            
     63//          if (strtolower($class) != strtolower($tableName)) 
     64//          { 
     65//            $class = $tableName; 
     66//            $checkName = $columnName; 
     67//          }      
    6768                
    68           $fieldName = $class.'['.str_replace('/', $tableDelimiter, $checkName).']'; 
    69           $fieldMapping = str_replace('/', $tableDelimiter, $columnName); 
     69          $fieldName = str_replace('/', $tableDelimiter, $column->key); 
    7070           
    71           $listDisplay[$i++] = array('name' => $fieldName
    72                                      'mapping' => $fieldMapping
     71          $listDisplay[$i++] = array('name' => $tableName.'['.$fieldName.']'
     72                                     'mapping' => $fieldName
    7373                                     'type' => extjs_convert_propel_type($column->getType()) 
    7474                                     ); 
    7575        } 
    7676 
    77         $options = array('id' => $prefix.$tableDelimiter.$pkn, 
     77        $options = array('id' => $pkn, 
    7878                         'root' => 'data', 
    7979                         'totalProperty' => 'totalCount'); 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__edit_form_ajax_inner.php

    r7356 r7468  
    111111[?php //load current details (if not new) ?] 
    112112[?php if (!$<?php echo $this->getSingularName() ?>->isNew()): ?]  
    113 <?php 
    114 /* 
    115   $columns = $this->getListUniqueColumns($groupedColumns); 
    116   $tableName = $this->getTableName(); 
    117   $skip = array(); 
    118    
    119   foreach ($columns as $column): 
    120     $columnName = $column->key; 
    121     // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    122     list($class, $checkName) = explode('/', $columnName, 2); 
    123       
    124     if (strtolower($class) != strtolower($tableName)) 
    125     { 
    126       $checkName = $columnName; 
    127     } 
    128      
    129     // skip local fields 
    130     if (false === strpos($checkName, '/')) continue; 
    131       
    132     list($relatedTableName, $relatedColumnName) = explode('/', $checkName, 2); 
    133      
    134     if (in_array($relatedTableName, $skip)) continue; // been there done that 
    135  
    136   $skip[] = $relatedTableName; 
    137   endforeach; 
    138 */  
    139 ?> 
    140  
    141113      ds_<?php echo $edit_name ?>.on('load', <?php echo $edit_ns ?>.data_loaded); 
    142       ds_<?php echo $edit_name ?>.load({params: {filter: 1, 'filters[<?php echo $prefix.$pkn ?>]':[?php echo $sf_request->getParameter('<?php echo $pkn ?>', 0) ?]}}); 
    143        
     114      ds_<?php echo $edit_name ?>.load({params: {filter: 1, 'filters[<?php echo $pkn ?>]':[?php echo $sf_request->getParameter('<?php echo $pkn ?>', 0) ?]}}); 
    144115[?php endif; ?] 
    145116         
     
    199170//  $column->key = $prefix.$column->key; 
    200171  $columnName = $column->key ; 
    201    
    202   // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    203   list($class, $checkName) = explode('/', $columnName, 2); 
    204   $tableMap = $this->getTableMap(); 
    205   $tableName = $tableMap->getName(); 
    206     
    207   if (strtolower($class) != strtolower($tableName)) 
    208   { 
    209     $checkName = $columnName; 
    210   } 
    211172?>  
    212 <?php if (in_array($checkName, $hides)) continue ?> 
     173<?php if (in_array($column->key, $hides)) continue ?> 
    213174<?php if ($column->isPrimaryKey()) continue ?> 
    214 <?php $credentials = $this->getParameterValue($edit_key.'.fields.'.$checkName.'.credentials') ?> 
     175<?php $credentials = $this->getParameterValue($edit_key.'.fields.'.$column->key.'.credentials') ?> 
    215176<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
    216177    [?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?] 
    217178<?php endif; ?> 
    218179<?php 
    219   $tableMap = $this->getTableMap(); 
    220   $tableName = $tableMap->getName(); 
    221   $fieldName = str_replace('/', $tableDelimiter, $checkName); 
     180  $tableName = $this->getTableName(); 
     181  $last = strrpos($column->key, '/'); 
     182  $relatedTableFKs = substr($column->key, 0, $last); 
     183  $fieldName = str_replace('/', $tableDelimiter, $column->key); 
    222184  $options = array('name' => strtolower($tableName).'['.$fieldName.']', 
    223185                   'width' => 175); 
     
    283245      // TODO: this is a hack! this should be fixed by letting getColumnAjaxTag take the relative $columnName into account, something like $this->getColumnAjaxTag($column, $checkName or $columnName) 
    284246      // Due to this hack the column looses all info (like type, length, etc)  
    285       $column2 = $this->getAdminColumnForField($checkName); 
     247      $column2 = $this->getAdminColumnForField($column->key); 
    286248    ?>     
    287249    // this should be done elsewhere... 
     
    312274      },  // end init 
    313275 
     276 
     277<?php  // todo: this code below has to be done for every column above, like in _related_ajax_renderer.php. Maybe we can also reuse some more code! ?> 
    314278      data_loaded : function() { 
    315279        // -- add preloaded data to the related stores 
     
    325289      foreach ($columnsFromGroup as $column) 
    326290      { 
    327         $columnName = $column->getTableName().'/'.$column->getName(); 
    328         // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    329         list($class, $checkName) = explode('/', $columnName, 2); 
    330         $tableMap = $this->getTableMap(); 
    331         $tableName = $tableMap->getName(); 
    332           
    333         if (strtolower($class) != strtolower($tableName)) 
    334         { 
    335           $checkName = $columnName; 
    336         } 
     291        // correction to key 
     292        $column->key = $column->getTableName().'/'.$column->key; 
    337293                        
    338         $listDisplay[] = array('name' => str_replace('/', $tableDelimiter, $checkName), 'mapping' => str_replace('/', $tableDelimiter, $checkName));  
     294        $listDisplay[] = array('name' => str_replace('/', $tableDelimiter, $column->key), 'mapping' => str_replace('/', $tableDelimiter, $column->key));  
    339295      } 
    340296    } 
    341297     
    342     $foreign_key = $this->getForeignKeyToTable($relatedTableName, $groupedColumns); 
    343     list($foreign_class, $foreign_checkName) = explode('/', $foreign_key, 2); 
    344  
    345     $tableMap = $this->getTableMap(); 
    346     $tableName = $tableMap->getName(); 
    347       
    348     if (strtolower($foreign_class) == strtolower($tableName)) 
    349     { 
    350       $foreign_key = $foreign_checkName; 
    351     } 
    352  
    353     $tableMap = $this->getTableMap(); 
    354     $tableName = $tableMap->getName(); 
    355298?> 
    356299        var Record = Ext.data.Record.create(<?php echo _extjs_property_encode($listDisplay) ?>); 
     
    360303        var record_data = Array(); 
    361304      
    362         record_data['<?php echo $pk ?>'] = ds_<?php echo $edit_name ?>.getAt(index).get('<?php echo strtolower($tableName).'['.$foreign_key.']' ?>');; 
     305        record_data['<?php echo $pk ?>'] = ds_<?php echo $edit_name ?>.getAt(index).get('<?php echo $relatedTableFKs ?>');; 
    363306<?php 
    364307    // iterate through all requested columns of current class 
    365308    foreach ($relatedClass['columns'] as $group => $columnsFromGroup): 
    366309    foreach ($columnsFromGroup as $column): 
    367       $columnName = strtolower($column->getTableName().'/'.$column->getPhpName()); 
    368        
    369       // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    370       list($class, $checkName) = explode('/', $columnName, 2); 
    371       $tableMap = $this->getTableMap(); 
    372       $tableName = $tableMap->getName(); 
    373         
    374       if (strtolower($class) != strtolower($tableName)) 
    375       { 
    376         $checkName = $columnName; 
    377         $columnName = $tableName.'/'.$columnName; 
    378       } 
     310      //correction for key 
     311      $column->key = strtolower($column->getTableName().'/'.$column->key); 
    379312         
    380       $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials'); 
     313      $credentials = $this->getParameterValue('list.fields.'.$column->key.'.credentials'); 
    381314?> 
    382315<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
    383316[?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?] 
    384317<?php endif; ?> 
    385         record_data['<?php echo str_replace('/', $tableDelimiter, $checkName) ?>'] = ds_<?php echo $edit_name ?>.getAt(index).get('<?php echo $tableName.'['.str_replace('/', $tableDelimiter, $checkName).']' ?>'); 
     318        record_data['<?php echo str_replace('/', $tableDelimiter, $column->key) ?>'] = ds_<?php echo $edit_name ?>.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $column->key) ?>'); 
    386319<?php 
    387320    //don't add it twice 
    388     $hs[] = $checkName
     321    $hs[] = $column->key
    389322?> 
    390323<?php if ($credentials): ?> 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/__json_td.php

    r7411 r7468  
    3939 
    4040  // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    41   list($class, $checkName) = explode('/', $columnName, 2); 
    42     
    43   if (strtolower($class) != strtolower($tableName)) 
    44   { 
    45     $checkName = $columnName; 
    46   } 
     41//  list($class, $checkName) = explode('/', $columnName, 2); 
     42//    
     43//  if (strtolower($class) != strtolower($tableName)) 
     44//  { 
     45//    $checkName = $columnName; 
     46//  } 
    4747   
    4848  // want to see in the datastore still 
    4949  //if (in_array($checkName, $hs)) continue; 
    5050 
    51   $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials'); 
     51  $credentials = $this->getParameterValue('list.fields.'.$columnName.'.credentials'); 
    5252 
    5353?> 
     
    6767    // TODO: this is a hack! this should be fixed by letting getColumnAjaxTag take the relative $columnName into account, something like $this->getColumnAjaxTag($column, $checkName or $columnName) 
    6868    // Due to this hack the column looses all info (like type, length, etc and keys (like isPartial, isLink, isComponent )  
    69     $column = $this->getAdminColumnForField($checkName); 
     69    $column = $this->getAdminColumnForField($columnName); 
    7070  } 
    7171   
     
    7474 
    7575  //don't add it twice 
    76   $hs[] = $checkName; 
     76  $hs[] = $columnName; 
    7777 
    7878  $i++; 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_json_autocomplete_td.php

    r7179 r7468  
    1818  { 
    1919    $pkr = clone($relatedGroupedColumns['pk']); //copy by value, you don't want to add $pk->key to groupedColumns['pk'] 
    20     $pkr->key = strtolower($pk->getTableName().'/'.$pkr->getTableName().'/'.$pkr->getName()); 
     20    //correction of key 
     21    $pkr->key = strtolower($pkr->getTableName().'/'.$pkr->getName()); 
    2122     
    2223    $columns[] = $pkr; // add related primary key 
     
    3233 
    3334foreach ($columns as $column) : 
    34   $columnName = $column->key; 
     35//  $columnName = $column->key; 
    3536  // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    36   list($class, $checkName) = explode('/', $columnName, 2); 
    37     
    38   if (strtolower($class) != strtolower($tableName)) 
    39   { 
    40     $checkName = $columnName; 
    41   } 
     37//  list($class, $checkName) = explode('/', $columnName, 2); 
     38//    
     39//  if (strtolower($class) != strtolower($tableName)) 
     40//  { 
     41//    $checkName = $columnName; 
     42//  } 
    4243   
    4344  // skip local fields 
    44   if (false === strpos($checkName, '/')) continue; 
     45  if (false === strpos($column->key, '/')) continue; 
    4546    
    46   list($relatedTableName, $relatedColumnName) = explode('/', $checkName, 2); 
     47  list($relatedTableName, $relatedColumnName) = explode('/', $column->key, 2); 
     48  $relatedTableName = $column->getTable()->getName(); 
    4749 
    4850  // skip foreign related fields 
     
    5052   
    5153  // check if hidden 
    52   if (in_array($checkName, $hs)) continue; 
     54  if (in_array($column->key, $hs)) continue; 
    5355   
    54   $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials'); 
     56  $credentials = $this->getParameterValue('list.fields.'.$column->key.'.credentials'); 
    5557?> 
    5658<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
     
    6365  // TODO: to make it work with componentents and partials, check the method getColumnAjaxDefinition instead of processColumnAutocompleteName (which can than get private)  
    6466?> 
    65   "<?php echo str_replace('/',$tableDelimiter, $checkName) ?>": "[?php echo str_replace('"', '\"', $results->get<?php echo sfInflector::camelize($relatedColumnName) ?>() ) ?]" 
     67  "<?php echo $relatedTableName.$tableDelimiter.$column->getName() ?>": "[?php echo str_replace('"', '\"', $results->get<?php echo sfInflector::camelize($relatedColumnName) ?>() ) ?]" 
    6668  [?php $i++; ?] 
    6769[?php endif; ?] 
    6870<?php 
    6971  //don't add it twice 
    70   $hs[] = $checkName
     72  $hs[] = $column->key
    7173?> 
    7274<?php if ($credentials): ?> 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_columnmodel.php

    r7237 r7468  
    3737 
    3838foreach ($columns as $column) : 
    39   $columnName = $column->key; 
     39//  $columnName = $column->key; 
    4040 
    4141  // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    42   list($class, $checkName) = explode('/', $columnName, 2); 
    43     
    44   if (strtolower($class) != strtolower($tableName)) 
    45   { 
    46     $checkName = $columnName; 
    47   } 
     42//  list($class, $checkName) = explode('/', $columnName, 2); 
     43//    
     44//  if (strtolower($class) != strtolower($tableName)) 
     45//  { 
     46//    $checkName = $columnName; 
     47//  } 
    4848 
    4949  if(count($this->getParameterValue('list.expander')) != 0) 
     
    5353  } 
    5454   
    55   if (in_array($checkName, $hs)) continue; 
     55  if (in_array($column->key, $hs)) continue; 
    5656   
    57   $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials'); 
     57  $credentials = $this->getParameterValue('list.fields.'.$column->key.'.credentials'); 
    5858 
    5959?> 
     
    6464<?php 
    6565 
    66   $id = str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$checkName.'.params.id')); 
     66  $id = str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->key.'.params.id')); 
    6767   
    68   $header = str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$checkName.'.name')); 
     68  $header = str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->key.'.name')); 
     69 
     70  $dataIndex = str_replace('/', $tableDelimiter, $column->key); 
    6971   
    70   $dataIndex = str_replace('/', $tableDelimiter, $columnName); 
    71    
    72   $width = $this->getParameterValue('list.fields.'.$checkName.'.params.width'); 
     72  $width = $this->getParameterValue('list.fields.'.$column->key.'.params.width'); 
    7373 
    7474?> 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_filter.php

    r6892 r7468  
    3333     
    3434    // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    35     list($class, $checkName) = explode('/', $columnName, 2); 
    36       
    37     if (strtolower($class) != strtolower($tableName)) 
    38     { 
    39       $checkName = $columnName; 
    40     }     
     35//    list($class, $checkName) = explode('/', $columnName, 2); 
     36//      
     37//    if (strtolower($class) != strtolower($tableName)) 
     38//    { 
     39//      $checkName = $columnName; 
     40//    }     
    4141?> 
    42 <?php $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials') ?> 
     42<?php $credentials = $this->getParameterValue('list.fields.'.$columnName.'.credentials') ?> 
    4343<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
    4444    [?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?] 
     
    4646<?php 
    4747  //TODO, change this so drop-down columnboxes and checkboxes appear... 
    48   $formFields[] = array('fieldLabel' => str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$checkName.'.name')), 'name' => 'filters['.str_replace('/', $tableDelimiter, $columnName).']'); 
     48  $formFields[] = array('fieldLabel' => str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$columnName.'.name')), 'name' => 'filters['.str_replace('/', $tableDelimiter, $columnName).']'); 
    4949?> 
    5050<?php if ($credentials): ?> 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_layout.php

    r7412 r7468  
    99$tableDelimiter = sfConfig::get('app_sf_extjs_theme_plugin_table_delimiter', '-'); 
    1010 
    11 $tableName = $this->getTableName(); 
    12 $prefix = $tableName; 
     11//$tableName = $this->getTableName(); 
     12//$prefix = $tableName; 
    1313 
    1414$limit = $this->getParameterValue('list.max_per_page', sfConfig::get('app_sf_extjs_theme_plugin_list_max_per_page', 20)); 
     
    5454  ( 
    5555    'parameters' => 'row, index', 
    56     'source' => "if (!row.data['".$prefix.$tableDelimiter.$pkn."']) return 'x-grid-group-body-hide';" 
     56    'source' => "if (!row.data['".$pkn."']) return 'x-grid-group-body-hide';" //$prefix.$tableDelimiter. 
    5757  )); 
    5858   
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_renderer.php

    r7087 r7468  
    4141     
    4242    // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    43     list($class, $checkName) = explode('/', $columnName, 2); 
    44       
    45     if (strtolower($class) != strtolower($tableName)) 
    46     { 
    47       $checkName = $columnName; 
    48     } 
     43//    list($class, $checkName) = explode('/', $columnName, 2); 
     44//      
     45//    if (strtolower($class) != strtolower($tableName)) 
     46//    { 
     47//      $checkName = $columnName; 
     48//    } 
    4949 
    5050    //check if field is foreign 
    51     if (false !== strpos($checkName, '/')) 
     51    if (false !== strpos($column->key, '/')) 
    5252    { 
    53       $last = strrpos($checkName, '/'); 
    54       $relatedTableName = substr($checkName, 0, $last); 
    55       $key_name = $this->getForeignKeyToTable($relatedTableName, $groupedColumns); 
     53      $last = strrpos($column->key, '/'); 
     54      $relatedTableFK = substr($column->key, 0, $last); 
     55      $record_pkn = $relatedTableFK; 
     56      //$key_name = str_replace('/', $tableDelimiter, $column->key);//$this->getForeignKeyToTable($relatedTableName, $groupedColumns); 
    5657 
    57       $subGroupedColumn = $this->getSubGroupedColumns($relatedTableName,$groupedColumns); 
     58      $subGroupedColumn = $this->getSubGroupedColumns($relatedTableFK,$groupedColumns); 
    5859      $relatedTablePK = $subGroupedColumn['pk'];   
    5960    } 
    6061    else 
    6162    { 
    62       $key_name = $tableName.'/'.$pkn;  
     63      $record_pkn = $pkn; //$tableName.'/'.  
    6364    } 
    6465 
    6566    //header values 
    6667//    $pieces = explode('/', $key_name); 
    67     $url_pkn = $relatedTablePK->getName(); 
    68     $record_pkn = str_replace('/', $tableDelimiter, $key_name); 
     68//    $url_pkn = $relatedTablePK->getName(); 
     69//    $record_pkn = str_replace('/', $tableDelimiter, $key_name); 
    6970     
    70     $h_tableName = $relatedTableName;  
    71     $h_moduleName = $h_tableName; //TODO: this probably is not always the same! 
     71    $relatedTableName = $relatedTablePK->getTableName();  
     72    $h_moduleName = $relatedTableName; //TODO: table-name not always the same as moduleName, need extra user-defined translation (alread implemented/used elsewhere, with extra info from generator.yml file!) 
    7273     
    73     $params = $this->getParameterValue('list.fields.'.$checkName.'.params'); 
     74    $params = $this->getParameterValue('list.fields.'.$column->key.'.params'); 
    7475    $params = is_array($params) ? $params : sfToolkit::stringToArray($params); 
    7576    $h_valuePrefix = isset($params['header_valuePrefix']) ? $params['header_valuePrefix'] : ''; 
     
    8283      $default_collapse = false; 
    8384      //TODO remove hardcoded tag for underline, add option to set stylesheet-class, don't forget to remove the closing tag as well... 
    84       $headerText .= "<u><a href=\'".$controller->genUrl($h_moduleName."/edit?".$url_pkn."=")."/'+record.data['".$record_pkn."']+'\' id=\'".$h_moduleName."'+record.data['".$record_pkn."']+'\'>"; 
     85      $headerText .= "<u><a href=\'".$controller->genUrl($h_moduleName."/edit?".$relatedTablePK->getName()."=")."/'+record.data['".$record_pkn."']+'\' id=\'".$h_moduleName."'+record.data['".$record_pkn."']+'\'>"; 
    8586    } 
    8687    $headerText .= $h_valuePrefix."'+record.data['".str_replace('/', $tableDelimiter, $columnName)."']+'".$h_valueSuffix; 
     
    131132 
    132133<?php  
    133   $key = $prefix.$pkn;  
     134  $key = $pkn; //$prefix.  
    134135?> 
    135136    // TODO: remove hardcoded html-tags, set css  
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_related_ajax_renderer.php

    r7356 r7468  
    1313  $groupedColumns = $this->getColumnsGrouped($for, true); 
    1414  $columns = $this->getListRelatedColumns($groupedColumns, false); 
    15   //$tableName = strtolower($groupedColumns['pk']->getTableName()); 
    16   $tableName = $this->getTableName(); 
    1715   
    1816  //iterate through all related columns 
    1917  foreach ($columns as $column) : 
    20     $columnName = $column->key; 
    21     // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    22     list($class, $checkName) = explode('/', $columnName, 2); 
    23       
    24     if (strtolower($class) != strtolower($tableName)) 
    25     { 
    26       $checkName = $columnName; 
    27     } 
    28    
     18    $last = strrpos($column->key, '/'); 
     19    $relatedTableFKs = substr($column->key, 0, $last); 
     20 
    2921    // can we skip it? 
    30     if (in_array($checkName, $hs)) continue; 
     22    if (in_array($column->key, $hs)) continue; 
    3123    if ($column->isPrimaryKey()) continue; 
    3224    if ($column->isForeignKey()) continue; 
    3325     
    3426    // or are we looking for it? Columns defined as 'table/field' 
    35     if (false === strpos($checkName, '/')) 
     27    if (false === strpos($column->key, '/')) 
    3628    { 
    3729      continue; 
    3830    } 
    39     else 
    40     { 
    41       $last = strrpos($checkName, '/'); 
    42       $relatedTableName = substr($checkName, 0, $last); 
    43       $key_name = $this->getForeignKeyToTable($relatedTableName, $groupedColumns); 
    4431 
    45       $subGroupedColumn = $this->getSubGroupedColumns($relatedTableName,$groupedColumns); 
    46       $relatedTablePK = $subGroupedColumn['pk']; 
    47     } 
    48  
    49     $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials'); 
     32    $credentials = $this->getParameterValue('list.fields.'.$column->key.'.credentials'); 
    5033?> 
    5134<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
     
    5437<?php  
    5538   
    56   //get last related table 
    57   if (strrpos($relatedTableName, '/'))  
    58   { 
    59     $tables = explode('/', $relatedTableName); 
    60     $relatedTableName = $tables[count($tables)-1]; 
    61   } 
     39  $relatedTableName = $column->getTable()->getName();  
    6240 
    6341  //TODO: maybe rendername should contain all related-tablenames, not only last related-table 
    64   $rendererName = ucfirst($relatedTableName).ucfirst($column->getName())  
     42  $rendererName = sfInflector::camelize(str_replace('/', '_', $column->key));//ucfirst($relatedTableName).ucfirst($column->getName())  
    6543?> 
    6644      function render<?php echo $rendererName ?>Field(value) { 
     
    6846<?php 
    6947  //set name (from column of related JSON-DataStore) 
    70   if (false !== strpos($checkName, '/')) 
    71   { 
    72     $name = $column->getName(); 
    73   } 
    7448  $foreign_ds = sfInflector::underscore($relatedTableName)."_ds"; 
     49 
     50  $name = $column->getName(); 
     51  $last = strrpos($column->key, '/'); 
     52  $relatedTableFKs = substr($column->key, 0, $last); 
    7553?> 
    7654          // if value in foreign datastore, return this value 
    7755          if (<?php echo $foreign_ds ?>.getById(value)) { 
    78             return <?php echo $foreign_ds ?>.getById(value).get('<?php echo $relatedTableName.$tableDelimiter.$name ?>'); 
     56            return <?php echo $foreign_ds ?>.getById(value).get('<?php echo $name ?>'); 
    7957          // if not in foreign datastore, test if it is preloaded (this can be out-dated therefor do it after checking datastore) 
    80           } else if ((index = ds_list.find('<?php echo str_replace('/', $tableDelimiter, $key_name) ?>', value)) != -1)  { 
     58          } else if ((index = ds_list.find('<?php echo str_replace('/', $tableDelimiter, $relatedTableFKs) ?>', value)) != -1)  { 
    8159            // foreign-ID not known in foreign-store yet, add preloaded data from the main-store 
    82             <?php echo $foreign_ds ?>_add_preloaded_from_index(index, value); 
     60            <?php echo $rendererName?>AddPreloadedFromIndex(index, value); 
    8361 
    84             return ds_list.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $columnName) ?>'); 
     62            return ds_list.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $column->key) ?>'); 
    8563          } else { 
    8664            //TODO if value still not found the foreign-data-store should get it from the server! (but I don't think this will be necesarry occur) 
     
    8967        } 
    9068      } 
     69       
     70       
     71       
     72      // Define related renderer-helpers to show preloaded data; prevent loading all related data stores 
     73      function <?php echo $rendererName ?>AddPreloadedFromIndex(index, value) { 
    9174<?php 
    92   //don't add it twice 
    93   $hs[] = $checkName; 
    94 ?> 
    95 <?php if ($credentials): ?> 
    96     [?php endif; ?] 
    97 <?php endif; ?> 
    98 <?php endforeach; ?> 
     75    $hs2 = array(); 
    9976 
    100 // Define related renderer-helpers to show preloaded data; prevent loading all related data stores 
    101 <?php if(array_key_exists('related', $groupedColumns)): ?> 
    102 <?php foreach ($groupedColumns['related'] as $relatedTableName => $relatedClass): ?> 
    103       function <?php echo strtolower($relatedTableName) ?>_ds_add_preloaded_from_index(index, value) { 
    104  
    105 <?php 
     77    $relatedClass = $groupedColumns['related'][$relatedTableName]; 
     78     
    10679    $pk = $relatedTableName.$tableDelimiter.$relatedClass['pk']->getName(); 
     80    $listDisplay = array(array('name' => $pk, 'mapping' => $pk)); 
    10781     
    108     $listDisplay = array(array('name' => $pk, 'mapping' => $pk)); 
    10982    foreach ($relatedClass['columns'] as $group => $columnsFromGroup) 
    11083    { 
    111       foreach ($columnsFromGroup as $column
     84      foreach ($columnsFromGroup as $column2
    11285      { 
    113         $columnName = $column->getTableName().'/'.$column->getName(); 
    114         // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    115         list($relatedTableName, $checkName) = explode('/', $columnName, 2); 
    116           
    117         if (strtolower($relatedTableName) != strtolower($tableName)) 
    118         { 
    119           $checkName = $columnName; 
    120         } 
    121                         
    122         $listDisplay[] = array('name' => str_replace('/', $tableDelimiter, $checkName), 'mapping' => str_replace('/', $tableDelimiter, $checkName));  
     86        $columnName2 = $column2->getTableName().'/'.$column2->getName(); 
     87         
     88        if (in_array($columnName2, $hs2)) continue; 
     89         
     90        $listDisplay[] = array('name' => str_replace('/', $tableDelimiter, $columnName2), 'mapping' => str_replace('/', $tableDelimiter, $columnName2));  
     91 
     92        $hs2[] = $columnName2; 
    12393      } 
    124     } 
     94    }     
    12595?> 
    12696        var Record = Ext.data.Record.create(<?php echo _extjs_property_encode($listDisplay) ?>); 
     
    131101        record_data['<?php echo $pk ?>'] = value; 
    132102<?php 
     103      $hs2 = array(); 
    133104      // iterate through all requested columns of current class 
    134105      foreach ($relatedClass['columns'] as $group => $columnsFromGroup): 
    135       foreach ($columnsFromGroup as $column): 
    136         $columnName = strtolower($column->getTableName().'/'.$column->getPhpName()); 
     106      foreach ($columnsFromGroup as $column2): 
     107        $columnName2 = $column->getTableName().'/'.$column2->getName(); 
    137108         
    138         // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    139         list($relatedTableName, $checkName) = explode('/', $columnName, 2); 
    140           
    141         if (strtolower($relatedTableName) != strtolower($tableName)) 
    142         { 
    143           $checkName = $columnName; 
    144           $columnName = strtolower($tableName).'/'.$columnName; 
    145         } 
     109        if (in_array($columnName2, $hs2)) continue; 
    146110         
    147         $credentials = $this->getParameterValue('list.fields.'.$checkName.'.credentials'); 
     111        $credentials = $this->getParameterValue('list.fields.'.$columnName2.'.credentials'); 
    148112?> 
    149113<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?> 
    150114      [?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?] 
    151115<?php endif; ?> 
    152         record_data['<?php echo str_replace('/', $tableDelimiter, $checkName) ?>'] = ds_list.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $columnName) ?>'); 
    153 <?php 
    154     //don't add it twice 
    155     $hs[] = $checkName; 
    156 ?> 
     116        record_data['<?php echo str_replace('/', $tableDelimiter, $columnName2) ?>'] = ds_list.getAt(index).get('<?php echo str_replace('/', $tableDelimiter, $relatedTableFKs).$tableDelimiter.$column2->getName() ?>'); 
    157117<?php if ($credentials): ?> 
    158118      [?php endif; ?] 
    159119<?php endif; ?> 
     120<?php 
     121    //don't add it twice 
     122    $hs2[] = $columnName2; 
     123?> 
    160124<?php endforeach; ?> 
    161125<?php endforeach; ?> 
     
    164128        <?php echo strtolower($relatedTableName) ?>_ds.add(r); 
    165129      } 
     130             
     131<?php 
     132  //don't add it twice 
     133  $hs[] = $column->key; 
     134?> 
     135<?php if ($credentials): ?> 
     136    [?php endif; ?] 
     137<?php endif; ?> 
    166138<?php endforeach; ?> 
    167 <?php endif; ?> 
     139 
  • plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php

    r7413 r7468  
    312312    $pk = $pks[0]->getPhpName(); 
    313313     
    314     // TODO: check if this is the new method (see below) 
    315     return $this->getAdminColumnForField($pk); 
     314    return new sfAdminColumn($pk, $pks[0], null); 
    316315  } 
    317316     
     
    343342    { 
    344343      // create and catch exception caused by model classes starting with a lower case character 
    345       try 
    346       { 
     344//      try 
     345//      { 
    347346        $tableMap = @call_user_func(array($peerName, 'getTableMap')); 
    348         if(!$tableMap) throw new Exception(); 
    349       } 
    350       catch(Exception $e) 
    351       { 
    352         $tableMap = call_user_func(array(strtolower(substr($peerName, 0, 1)) . substr($peerName, 1), 'getTableMap')); 
    353       } 
     347//        if(!$tableMap) throw new Exception(); 
     348//      } 
     349//      catch(Exception $e) 
     350//      { 
     351//        $tableMap = call_user_func(array(strtolower(substr($peerName, 0, 1)) . substr($peerName, 1), 'getTableMap')); 
     352//      } 
    354353       
    355354      foreach ($tableMap->getColumns() as $col) 
     
    357356        if ($col->isPrimaryKey()) 
    358357        { 
    359           $column = $this->getAdminColumnForField($col->getPhpName(), null, $peerName); 
     358          $column = new sfAdminColumn($col->getPhpName(), $col, null); 
    360359          $groupedColumns['pk'] = $column;  
    361360          break; // end foreach when found 
     
    381380      { 
    382381        $columnPhpName = $column->getPhpName(); 
    383         list($relatedSingularClassName, $none) = explode('::', $columnPhpName, 2); 
     382        list($relatedTablePhpName, $none) = explode('::', $columnPhpName, 2); 
    384383        list($none, $relatedColumnName) = explode('/', $columnName, 2); 
    385384         
    386         $relatedPeerName = $relatedSingularClassName.'Peer'; 
    387         $relatedTableName = sfInflector::underscore($relatedSingularClassName); 
     385        $relatedPeerName = $relatedTablePhpName.'Peer'; 
     386//        $relatedTableName = sfInflector::underscore($relatedTablePhpName); 
    388387//        $relatedColumnName = str_replace('::', '/', $relatedColumnName); // Change back :: to / for relatedColumnName 
    389388         
     
    394393        { 
    395394          // Search for ForeignKey 
    396           if ($col->getRelatedTableName() == $relatedTableName
     395          if ($col->getRelatedTableName() != ''
    397396          { 
    398             // Add ForeignKey to current columns (needed for drop-down boxes) 
    399             $colFKName = $col->getPhpName(); 
    400             $colFKUnderscore = sfInflector::underscore($colFKName); 
    401             $column = $this->getAdminColumnForField($colFKName, null, $peerName); 
    402             // add an option to which tells to hide this field (for iteration in grid and edit views) 
    403             // this way it CAN be used for en/de-coding in json-data   
    404             $column->visible = false;  
    405             $column->key = $colFKUnderscore; 
    406             $column->index = $i++; 
    407             $groupedColumns['columns'][$group][] = $column;  
    408              
    409             break; // stop foreach 
     397            $colRelatedTable = $this->getMap()->getDatabaseMap()->getTable($col->getRelatedTableName()); 
     398            if ($colRelatedTable->getPhpName() == $relatedTablePhpName) 
     399            { 
     400              // Add ForeignKey to current columns (needed for drop-down boxes) 
     401              $colFKName = $col->getPhpName(); 
     402              $colFKUnderscore = strtolower($col->getColumnName()); 
     403              $column = new sfAdminColumn($colFKName, $col, null); 
     404              // add an option to which tells to hide this field (for iteration in grid and edit views) 
     405              // this way it CAN be used for en/de-coding in json-data   
     406              $column->visible = false;  
     407              $column->key = $colFKUnderscore; 
     408              $column->index = $i++; 
     409              $groupedColumns['columns'][$group][] = $column;  
     410               
     411              $relatedTableName = $colRelatedTable->getName(); 
     412              break; // stop foreach 
     413            } 
    410414          } 
    411415        } 
     
    560564   * Returns a sub selection of columnsGrouped 
    561565   * 
    562    * @param string  $relatedTableName  the relatedTable (start with the base-table-name) 
     566   * @param string  $relatedTableFKs   the ForeignKey(s) to the relatedTable 
    563567   * @param array() $groupedColumns    Hierarchically arranged array with columns 
    564568   * @return subSelection of $groupedColumns 
    565569   */ 
    566   public function getSubGroupedColumns($relatedTableName, $groupedColumns) 
    567   { 
    568     $currentTableName = sfInflector::underscore($groupedColumns['pk']->getTable()->getPhpName())
    569      
     570  public function getSubGroupedColumns($relatedTableFKs, $groupedColumns) 
     571  { 
     572    $currentTableFK = $relatedTableFKs
     573    $nextTableFKs = null; 
    570574    // test if relatedTableName contains mainTable name at begin, if so remove it  
    571     if (false !== strpos($relatedTableName, '/')) 
    572     { 
    573       list($firstTableName, $nextTableNames) = explode('/', $relatedTableName, 2); 
    574        
    575       if ($currentTableName == $firstTableName)  
    576       { 
    577         $relatedTableName = $nextTableNames; 
    578       } 
    579     } 
    580      
    581     // test if relatedTableName contains mainTable name at begin, if so remove it  
    582     if (false !== strpos($relatedTableName, '/')) 
    583     { 
    584       list($firstTableName, $nextTableNames) = explode('/', $relatedTableName, 2); 
    585       return $this->getSubGroupedColumns($nextTableNames, $groupedColumns['related'][$firstTableName]); 
     575    if (false !== strpos($relatedTableFKs, '/')) 
     576    { 
     577      list($currentTableFK, $nextTableFKs) = explode('/', $relatedTableFKs, 2); 
     578    } 
     579     
     580    //translate foreign-key-name to table-name 
     581    $ColFK = $this->getColumnForFieldName($currentTableFK, $groupedColumns['pk']->getTable()->getPhpName().'Peer'); 
     582    $relatedTableName = $ColFK->getRelatedTableName(); 
     583     
     584    // recursion if remaining foreign-keys  
     585    if ($nextTableFKs) 
     586    { 
     587      return $this->getSubGroupedColumns($nextTableFKs, $groupedColumns['related'][$relatedTableName]); 
    586588    } 
    587589    else 
     
    599601   * @return string   the FK-name 
    600602   */ 
    601   public function getForeignKeyToTable($relatedTableName, $groupedColumns) 
     603  public function getOBSOLETEForeignKeyToTable($relatedTableName, $groupedColumns) // WARNING: this is can give wrong results when there are multiple foreign-keys to the same table!!! 
    602604  { 
    603605    //undefined variable notice thrown in dev environment without this 
     
    622624      list($relatedTableName, $relatedRelatedTableName) = explode('/', $relatedTableName, 2); 
    623625      //recursion 
    624       $field = $currentTableName.'/'.$this->getForeignKeyToTable($relatedRelatedTableName, $groupedColumns['related'][$relatedTableName]);  
     626      $field = $this->getOBSOLETEForeignKeyToTable($relatedRelatedTableName, $groupedColumns['related'][$relatedTableName]);  
    625627    } 
    626628    else // is directly related to current table 
     
    750752    } 
    751753     
    752     $prefix_org = $prefix; 
    753     $prefix .= sfInflector::underscore($groupedColumns['pk']->getTable()->getPhpName()).'/'; 
     754//    $prefix_org = $prefix; 
     755//    $prefix .= sfInflector::underscore($groupedColumns['pk']->getTable()->getPhpName()).'/'; 
    754756     
    755757    if ($addPK && $returnInvisible) 
     
    784786    } 
    785787    // Iterate through all its related tables recursively 
    786     $relatedColumnList = $this->getListRelatedColumns($groupedColumns, $returnInvisible, $groups, $prefix_org); 
     788    $relatedColumnList = $this->getListRelatedColumns($groupedColumns, $returnInvisible, $groups, $prefix); 
    787789    $columnList = array_merge($columnList, $relatedColumnList); 
    788790         
     
    807809     
    808810    // TODO: maybe filter this pk, if there is no matching group in this table, AND in any related tables 
    809     $prefix .= sfInflector::underscore($groupedColumns['pk']->getTable()->getPhpName()).'/'; 
     811//    $prefix .= sfInflector::underscore($groupedColumns['pk']->getTable()->getPhpName()).'/'; 
    810812 
    811813     
     
    813815    foreach($groupedColumns['related'] as $relatedName => $relatedTable) 
    814816    { 
    815       $relatedColumnList = $this->getListColumns($relatedTable, $returnInvisible, $groups, $prefix, false); 
     817      //search foreign-key 
     818      $found = false; 
     819      $foreign_col = null; 
     820      foreach($groupedColumns['columns'] as $group) 
     821      { 
     822        foreach($group as $adminCol) 
     823        { 
     824          if ($adminCol->getRelatedTableName() == $relatedName) 
     825          { 
     826            $foreign_col = $adminCol; 
     827            $found = true; 
     828            break 2;  
     829          } 
     830        } 
     831      } 
     832      if (!$found) 
     833      { 
     834        throw new Exception("Foreign key not found to table ".$relatedName); 
     835      } 
     836      $related_prefix = $prefix.strtolower($foreign_col->getColumnName()).'/'; 
     837      $relatedColumnList = $this->getListColumns($relatedTable, $returnInvisible, $groups, $related_prefix, false); 
    816838      $columnList = array_merge($columnList, $relatedColumnList); 
    817839    } 
     
    960982    $tableDelimiter = sfConfig::get('app_sf_extjs_theme_plugin_table_delimiter', '-'); 
    961983     
    962     $columnName = $column->key; 
     984//    $checkName = $column->key; 
    963985     
    964986    // remove base classname for checks (This way you can check on fields like name, instead of product/name) 
    965     list($class, $checkName) = explode('/', $columnName, 2); 
    966     if ($class != sfInflector::underscore($this->getClassName())) 
    967     { 
    968       $checkName = $columnName; 
    969     } 
    970      
    971     $user_params = $this->getParameterValue($for.'.fields.'.$checkName.'.params'); 
     987//    list($foreignKey) = explode('/', $columnName, 2); 
     988     
     989    $user_params = $this->getParameterValue($for.'.fields.'.$column->key.'.params'); 
    972990    $params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); 
    973991    //$params      = $user_params ? array_merge($params, $user_params) : $params; 
    974992     
    975993    // if hidden in edit-pages 
    976     if (($for == 'edit') && (strtolower($this->getParameterValue('edit.fields.'.$checkName.'.class', null))=='hidden')) 
     994    if (($for == 'edit') && (strtolower($this->getParameterValue('edit.fields.'.$column->key.'.class', null))=='hidden')) 
    977995    { 
    978996      return array( 
    979997        'class' => 'Hidden',  
    980998        'options' => array( 
    981           'name' => $class.'['.str_replace('/', $tableDelimiter, $checkName).']' 
     999          'name' => str_replace('/', $tableDelimiter, $column->key) 
    9821000        ) 
    9831001      ); 
     
    9851003 
    9861004    $groupBy = false; 
    987     if ($checkName == $this->getParameterValue('list.grouping.field', null)) 
     1005    if ($column->key == $this->getParameterValue('list.grouping.field', null)) 
    9881006    { 
    9891007      $groupBy = true; 
     
    10381056    // this column contains drop-down Combo-Boxes 
    10391057    // improve like this: http://extjs.com/deploy/dev/examples/form/forum-search.html So you are able to add new values! (although it would be nice to keep the drop-down button at the right, so don't hide the trigger) 
    1040     if ((false !== strpos($checkName, '/')) && ($groupedColumns!=Array())) 
    1041     { 
    1042       $last = strrpos($checkName, '/'); 
    1043       $relatedTableName = substr($checkName, 0, $last); 
    1044       $relatedTable = $this->getSubGroupedColumns($relatedTableName, $groupedColumns); 
    1045       $relatedColumn =  $this->getForeignKeyColumnToTable($relatedTableName, $groupedColumns); 
    1046       $comboName = $class.'['.sfInflector::underscore($relatedTable['pk']->getPhpName()).']'; 
    1047        
    1048       //get last related table 
    1049       if (strrpos($relatedTableName, '/'))  
    1050       { 
    1051         $tables = explode('/', $relatedTableName); 
    1052         $relatedTableName = $tables[count($tables)-1]; 
    1053       } 
    1054        
    1055       $valueFieldCombo = sfInflector::underscore($relatedTableName).$tableDelimiter.sfInflector::underscore($relatedTable['pk']->getPhpName()); 
    1056        
    1057       $store =  sfInflector::underscore($relatedTableName).'_ds'; 
    1058        
    1059       $cbOptions = array('hiddenName' => sfInflector::underscore($relatedTableName).'_'.$column->getName().'_combo', 
    1060                          'name' => sfInflector::underscore($relatedTableName).'_'.$column->getName().'_combo', 
     1058    if ((false !== strpos($column->key, '/')) && ($groupedColumns!=Array())) 
     1059    { 
     1060//      $relatedTable = $this->getSubGroupedColumns($relatedTableFKs, $groupedColumns); 
     1061//      $relatedFKColumn = $groupedColumns['columns'][$relatedTableFK]; //TODO: groups... 
     1062      $fields = explode('/', $column->key); 
     1063       
     1064      $last = strrpos($column->key, '/'); 
     1065      $relatedTableFKs = substr($column->key, 0, $last); 
     1066      $relatedTableGrouped = $this->getSubGroupedColumns($relatedTableFKs, $groupedColumns); 
     1067      $relatedTablePK = $relatedTableGrouped['pk'];  
     1068//      $relatedTableName = $this->getTableFromFK($relatedTableFKs);  
     1069//      $relatedFKColumn =  $this->getForeignKeyColumnToTable($relatedTableName, $groupedColumns); 
     1070      $relatedFKColumn = $this->getColumnForFieldName($fields[0]); 
     1071       
     1072//      $comboName = sfInflector::underscore($relatedTable['pk']->getPhpName()); //TODO, don't know if this is desired 
     1073       
     1074//      //get last related table 
     1075//      if (strrpos($relatedTableName, '/'))  
     1076//      { 
     1077//        $tables = explode('/', $relatedTableName); 
     1078//        $relatedTableName = $tables[count($tables)-1]; 
     1079//      } 
     1080       
     1081      //valuefield is the primary-key for the related table 
     1082      $valueFieldCombo = $relatedTablePK->getTableName().$tableDelimiter.$relatedTablePK->getName(); //sfInflector::underscore($relatedTableName).$tableDelimiter.sfInflector::underscore($relatedTable['pk']->getPhpName()); 
     1083      $displayFieldCombo = $column->getTableName().$tableDelimiter.$column->getName(); 
     1084       
     1085      $store =  sfInflector::underscore($column->getTableName()).'_ds'; 
     1086       
     1087      $cbOptions = array('hiddenName' => $column->getTableName().'_'.$column->getName().'_combo', 
     1088                         'name' => $column->getTableName().'_'.$column->getName().'_combo', 
    10611089                         'valueField' => $valueFieldCombo, 
    1062                          'displayField' => str_replace('/', $tableDelimiter, $checkName)
     1090                         'displayField' => $displayFieldCombo
    10631091                         'queryParam' => 'filters['.str_replace('/', $tableDelimiter, $column->key).']', 
    10641092                         'store' => $store, 
     
    10661094                         'lazyRender' => 'true', 
    10671095 
    1068                          'baseTable' => $class.'-', 
     1096//                         'baseTable' => $class.'-', 
    10691097                          
    10701098                         'showEditor' => 'function(){ 
    10711099                           var fields = new Array(); 
    1072                            fields[\''.str_replace('/', $tableDelimiter, $checkName).'\'] = this.getRawValue(); 
    1073                            show'.sfInflector::camelize($relatedTableName).'Editor(fields, this); 
     1100                           fields[\''.str_replace('/', $tableDelimiter, $column->getName()).'\'] = this.getRawValue(); 
     1101                           show'.sfInflector::camelize($column->getTableName()).'Editor(fields, this); 
    10741102                         }' 
    10751103 
     
    10781106       
    10791107      //override required check 
    1080       if ($relatedColumn->isNotNull()) 
     1108      if ($relatedFKColumn->isNotNull()) 
    10811109      { 
    10821110        $cbOptions['allowBlank'] = 'false'; 
     
    10901118      { 
    10911119         $cbOptions['allowBlank'] = 'true'; 
    1092          $cbOptions['blankText'] = ''
     1120         unset($cbOptions['blankText'])
    10931121          
    10941122        //reset $option as well 
    10951123        $options['allowBlank'] = 'true'; 
    1096         $options['blankText'] = ''; 
    1097       } 
     1124        unset($options['blankText']); 
     1125      } 
     1126       
     1127       
    10981128                         
    1099       $jsComboBox = extjs_form_combobox($cbOptions); 
    1100        
    11011129      if ($for == 'edit') 
    11021130      { 
    1103         list($class, $field) = explode('/', $this->getForeignKeyToTable($relatedTableName, $groupedColumns), 2); 
    1104         $comboName = $class.'['.str_replace('/', $tableDelimiter, $field).']'; 
     1131        //list($class, $field) = explode('/', $this->getForeignKeyToTable($relatedTableName, $groupedColumns), 2); 
     1132        $field = str_replace('/', $tableDelimiter, $column->key);//$this->getForeignKeyToTable($relatedTableName, $groupedColumns); 
     1133        $comboName = $groupedColumns['pk']->getTableName().'['.str_replace('/', $tableDelimiter, $relatedTableFKs).']'; 
    11051134 
    11061135        //add/overwrite some data 
     
    11181147          if ( (isset($params['editable']) && $params['editable']) || (!isset($params['editable']) && sfConfig::get('app_sf_extjs_theme_plugin_list_editable', false)) ) 
    11191148          { 
    1120             $valueField = str_replace('/', $tableDelimiter, $this->getForeignKeyToTable($relatedTableName, $groupedColumns)); 
     1149            $valueField = str_replace('/', $tableDelimiter, $column->key); //$this->getForeignKeyToTable($column->getTableName(), $groupedColumns) 
    11211150             
    1122             $definition['dataIndexNew'] = $valueField; 
     1151            $definition['dataIndexNew'] = str_replace('/', $tableDelimiter, $relatedTableFKs); 
     1152       
     1153            $jsComboBox = extjs_form_combobox($cbOptions); 
     1154             
    11231155            $definition['editor'] = $jsComboBox; 
    11241156          } 
    1125           $rendererName = ucfirst(str_replace('/', $tableDelimiter, $relatedTableName)).ucfirst($column->getName()); 
     1157          $rendererName = sfInflector::camelize(str_replace('/', '_', $column->key)); 
    11261158          $definition['renderer'] = 'render'.$rendererName.'Field'; 
    11271159        } 
     
    12411273    else if ($column->isPartial() && ($for =='edit')) 
    12421274    { 
    1243       $options['partname'] = $checkName
    1244       return array('class' => 'Partial', 'options' => $options, 'partname' => $checkName); 
     1275      $options['partname'] = $column->key
     1276      return array('class' => 'Partial', 'options' => $options, 'partname' => $column->key); 
    12451277    } 
    12461278    else 
     
    12891321  } 
    12901322   
    1291   /* This method overwrites the original method and adds the argument $peerName to it   
    1292    */ 
    1293   public function getAdminColumnForField($field, $flag = null, $peerName = null) 
    1294   { 
    1295   $phpName = sfInflector::camelize($field); 
    1296  
    1297   //not working 
    1298     /*$fields = explode('/', $field); 
    1299     $pointer = count($fields) - 1; 
    1300      
    1301     $phpName = sfInflector::camelize($fields[$pointer--]); 
    1302     while ($pointer >= 0 ) 
    1303     { 
    1304       $phpName = $this->getTableMap()->getDatabaseMap()->getTable($fields[$pointer--])->getPhpName().'::'.$phpName; 
    1305     }*/ 
    1306  
    1307     return new sfAdminColumn($phpName, $this->getColumnForPhpName($phpName, $peerName), $flag); 
    1308   } 
    1309  
    1310   /* This method overwrites the original method and adds the argument $peerName to it   
     1323  /* This method overwrites the original method so it can handle foreign-keys in the fieldname 
     1324   */ 
     1325  public function getAdminColumnForField($field, $flag = array(), $peerName = null) 
     1326  { 
     1327   
     1328    //re-disabled ;) 
     1329    //$phpName = sfInflector::camelize($field); 
     1330 
     1331    //Re-enabled 
     1332    $fields = explode('/', $field); 
     1333 
     1334    $lastPeerClassName = $this->getPeerClassName(); 
     1335    if ($peerName) 
     1336    { 
     1337      $lastPeerClassName = $peerName; 
     1338    } 
     1339    $phpName = "";  
     1340 
     1341    if (!in_array('_', $flag)) // no-partial 
     1342    { 
     1343      //get PHP-name for (all) foreign tables (from foreign-key) 
     1344      for ($i = 0; $i < count($fields); $i++) 
     1345      { 
     1346        $currentField = $fields[$i]; 
     1347        $tableMap = call_user_func(array($lastPeerClassName, 'getTableMap')); 
     1348        // search the matching column for this key 
     1349        $found = false; 
     1350        foreach ($tableMap->getColumns() as $column) 
     1351        { 
     1352          if ($column->getColumnName() == strtoupper($currentField)) // TODO not tested if strtoupper is always correct, maybe both strtoupper... 
     1353          { 
     1354            $found = true; 
     1355            break; 
     1356          } 
     1357        } 
     1358   
     1359        if (!$found) 
     1360        { 
     1361          throw new sfConfigurationException(sprintf('Illegal field-name provided, you should provide:<br> [foreignkey-field(s)/]fieldname<br>&nbsp;<br>E.G. city_id/country_id/name<br>to get the country-name for the city of this module (if this module contains a foreign-key city_id to a city table<br>&nbsp<br>Stopped while parcing: "<i>%s</i>" of "%s"', $fields[$i], $field)); 
     1362        } 
     1363         
     1364        if ($i != count($fields) - 1) 
     1365        { 
     1366          $relatedTableName = $column->getRelatedTableName(); 
     1367          $relatedTable = $this->getMap()->getDatabaseMap()->getTable($relatedTableName); 
     1368       
     1369          $phpName .= $relatedTable->getPhpName().'::'; 
     1370           
     1371          $lastPeerClassName = $relatedTable->getPhpName().'Peer'; 
     1372        }  
     1373        else 
     1374        { 
     1375          $phpName .= $column->getPhpName(); 
     1376        } 
     1377      } 
     1378    }  
     1379    else //partial 
     1380    { 
     1381      $phpName .= sfInflector::camelize($field); 
     1382    } 
     1383 
     1384    return new sfAdminColumn($phpName, $this->getColumnForPhpName($phpName, $lastPeerClassName), $flag); 
     1385  } 
     1386 
     1387  /* This method overwrites the original method, so it can handle phpNames containing classNames  
    13111388   *  
    13121389   * returns a column phpName or null if none was found 
     
    13141391  public function getColumnForPhpName($phpName, $peerName = null) 
    13151392  { 
    1316     // the base peerName will be this->PeerName 
     1393    //strip 
     1394    $fields = explode('::', $phpName); 
     1395    $phpName = $fields[count($fields) - 1]; 
     1396     
    13171397    if ($peerName == null) 
    13181398    { 
     
    13201400    } 
    13211401     
    1322     $tableMap = call_user_func(array($peerName, 'getTableMap'));  
    1323      
    1324     // search the matching column for this column name 
    1325  
     1402    if (count($fields)>1) 
     1403    { 
     1404      $className = $fields[count($fields) - 2]; 
     1405      $peerName = $className."Peer";  
     1406    } 
     1407     
     1408    $tableMap = call_user_func(array($peerName, 'getTableMap')); 
     1409     
     1410    // search the matching column for this PHPname 
    13261411    foreach ($tableMap->getColumns() as $column) 
    13271412    { 
    13281413      if ($column->getPhpName() == $phpName) 
    13291414      { 
    1330         $found = true; 
    1331  
    13321415        return $column; 
    13331416      } 
    13341417    } 
    13351418 
    1336     // not a "real" column, so we will simulate one 
     1419    // not a "real" column, so we return null 
    13371420    return null; 
    13381421  } 
    1339      
     1422 
     1423  /* This method returns the column from its (relative) fieldname 
     1424   * relative by providing foreign-keys  
     1425   *  
     1426   * returns the column from this (relative) fieldname 
     1427   */ 
     1428  public function getColumnForFieldName($fieldName, $peerName = null) 
     1429  { 
     1430    if ($peerName == null) 
     1431    { 
     1432      $peerName = $this->getPeerClassName(); 
     1433    } 
     1434    $tableMap = call_user_func(array($peerName, 'getTableMap')); 
     1435     
     1436    // recursion needed? 
     1437    if (false !== strpos($fieldName, '/')) 
     1438    { 
     1439      list($firstFieldName, $nextFieldNames) = explode('/', $fieldName, 2); 
     1440 
     1441      foreach ($tableMap->getColumns() as $column) 
     1442      { 
     1443        if ($column->getColumnName() == strtoupper($firstFieldName)) 
     1444        { 
     1445          $relatedTableName = $column->getRelatedTableName(); 
     1446          $relatedTable = $this->getMap()->getDatabaseMap()->getTable($relatedTableName); 
     1447       
     1448          $peerName = $relatedTable->getPhpName().'Peer'; 
     1449          return $this->getColumnForFieldName($nextFieldNames, $peerName); 
     1450        } 
     1451      } 
     1452    } 
     1453    // find and return column form current table 
     1454    else  
     1455    { 
     1456      // search the matching column for this PHPname 
     1457      foreach ($tableMap->getColumns() as $column) 
     1458      { 
     1459        if ($column->getColumnName() == strtoupper($fieldName)) 
     1460        { 
     1461          return $column; 
     1462        } 
     1463      } 
     1464    } 
     1465     
     1466    // column not found in this table, so we return null 
     1467    throw new Exception('field "'.$fieldName.'" not found in Peer "'.$peerName.'"'); 
     1468    return null; 
     1469  } 
     1470   
    13401471  public function getTableName($underscore = true) 
    13411472  { 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.