Development

Changeset 23950

You must first sign up to be able to contribute.

Changeset 23950

Show
Ignore:
Timestamp:
11/14/09 21:31:18 (5 years ago)
Author:
FabianLange
Message:

[1.2, 1.3, 1.4] fixed doctrine modules when dealing with multiple primary keys (closes #7571)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/deleteAction.php

    r13490 r23950  
    66    $this->getRoute()->getObject()->delete(); 
    77<?php else: ?> 
    8     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     8    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    99    $<?php echo $this->getSingularName() ?>->delete(); 
    1010<?php endif; ?> 
  • branches/1.2/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/editAction.php

    r12669 r23950  
    44    $this->form = new <?php echo $this->getModelClass().'Form' ?>($this->getRoute()->getObject()); 
    55<?php else: ?> 
    6     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     6    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    77    $this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>); 
    88<?php endif; ?> 
  • branches/1.2/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/showAction.php

    r15219 r23950  
    44    $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject(); 
    55<?php else: ?> 
    6     $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>); 
     6    $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>)); 
    77    $this->forward404Unless($this-><?php echo $this->getSingularName() ?>); 
    88<?php endif; ?> 
  • branches/1.2/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/updateAction.php

    r12669 r23950  
    55<?php else: ?> 
    66    $this->forward404Unless($request->isMethod('post') || $request->isMethod('put')); 
    7     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     7    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    88    $this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>); 
    99<?php endif; ?> 
  • branches/1.3/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/deleteAction.php

    r23810 r23950  
    66    $this->getRoute()->getObject()->delete(); 
    77<?php else: ?> 
    8     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     8    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    99    $<?php echo $this->getSingularName() ?>->delete(); 
    1010<?php endif; ?> 
  • branches/1.3/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/editAction.php

    r23810 r23950  
    44    $this->form = new <?php echo $this->getModelClass().'Form' ?>($this->getRoute()->getObject()); 
    55<?php else: ?> 
    6     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     6    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    77    $this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>); 
    88<?php endif; ?> 
  • branches/1.3/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/showAction.php

    r23810 r23950  
    44    $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject(); 
    55<?php else: ?> 
    6     $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>); 
     6    $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>)); 
    77    $this->forward404Unless($this-><?php echo $this->getSingularName() ?>); 
    88<?php endif; ?> 
  • branches/1.3/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/updateAction.php

    r23810 r23950  
    55<?php else: ?> 
    66    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT)); 
    7     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     7    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    88    $this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>); 
    99<?php endif; ?> 
  • branches/1.4/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/deleteAction.php

    r23810 r23950  
    66    $this->getRoute()->getObject()->delete(); 
    77<?php else: ?> 
    8     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     8    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    99    $<?php echo $this->getSingularName() ?>->delete(); 
    1010<?php endif; ?> 
  • branches/1.4/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/editAction.php

    r23810 r23950  
    44    $this->form = new <?php echo $this->getModelClass().'Form' ?>($this->getRoute()->getObject()); 
    55<?php else: ?> 
    6     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     6    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    77    $this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>); 
    88<?php endif; ?> 
  • branches/1.4/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/showAction.php

    r23810 r23950  
    44    $this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject(); 
    55<?php else: ?> 
    6     $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>); 
     6    $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>)); 
    77    $this->forward404Unless($this-><?php echo $this->getSingularName() ?>); 
    88<?php endif; ?> 
  • branches/1.4/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/updateAction.php

    r23810 r23950  
    55<?php else: ?> 
    66    $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT)); 
    7     $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
     7    $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>)); 
    88    $this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>); 
    99<?php endif; ?>