Development

Changeset 1268

You must first sign up to be able to contribute.

Changeset 1268

Show
Ignore:
Timestamp:
04/25/06 11:10:59 (7 years ago)
Author:
fabien
Message:

added 2 new methods to action class in admin generator (saveObject and deleteObject) to ease inheritance

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/data/generator/sfPropelAdmin/default/template/actions/actions.class.php

    r1256 r1268  
    6161 
    6262      $this->update<?php echo $this->getClassName() ?>FromRequest(); 
    63       $this-><?php echo $this->getSingularName() ?>->save(); 
     63 
     64      $this->save<?php echo $this->getClassName() ?>($this-><?php echo $this->getSingularName() ?>); 
    6465 
    6566      $this->setFlash('notice', 'Your modifications have been saved'); 
     
    8889    $this->forward404Unless($this-><?php echo $this->getSingularName() ?>); 
    8990 
    90     $this-><?php echo $this->getSingularName() ?>->delete(); 
     91    $this->delete<?php echo $this->getClassName() ?>($this-><?php echo $this->getSingularName() ?>); 
    9192 
    9293<?php foreach ($this->getColumnCategories('edit.display') as $category): ?> 
     
    114115 
    115116    return sfView::SUCCESS; 
     117  } 
     118 
     119  protected function save<?php echo $this->getClassName() ?>($<?php echo $this->getSingularName() ?>) 
     120  { 
     121    $<?php echo $this->getSingularName() ?>->save(); 
     122  } 
     123 
     124  protected function delete<?php echo $this->getClassName() ?>($<?php echo $this->getSingularName() ?>) 
     125  { 
     126    $<?php echo $this->getSingularName() ?>->delete(); 
    116127  } 
    117128