Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Address form.
  5. *
  6. * @package new_ref
  7. * @subpackage form
  8. * @author Your name here
  9. * @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
  10. */
  11. class AddressForm extends BaseAddressForm
  12. {
  13. public function configure()
  14. {
  15. $this->useFields(array('apogee_pays_id'));//, 'adr_1', 'adr2', 'adr_3', 'adr_foreign'));
  16. $this->widgetSchema['adr_1'] = new sfWidgetFormInputText();
  17. $this->validatorSchema['adr_1'] = new sfValidatorString();
  18. $this->widgetSchema['adr_2'] = new sfWidgetFormInputText();
  19. $this->validatorSchema['adr_2'] = new sfValidatorString();
  20. $this->widgetSchema['adr_3'] = new sfWidgetFormInputText();
  21. $this->validatorSchema['adr_3'] = new sfValidatorString();
  22. $this->widgetSchema['adr_foreign'] = new sfWidgetFormInputText();
  23. $this->validatorSchema['adr_foreign'] = new sfValidatorString();
  24. }
  25. // public function save($con = null) {
  26. // if($this->getValue('adr_1')) $label_adr=$this->getValue('adr_1');
  27. // $label_adr = $label_adr.'|';
  28. // if($this->getValue('adr_2')) $label_adr=$label_adr.$this->getValue('adr_2');
  29. // $label_adr = $label_adr.'|';
  30. // if($this->getValue('adr_3')) $label_adr=$label_adr.$this->getValue('adr_3');
  31. // $label_adr = $label_adr.'|';
  32. // if($this->getValue('adr_foreign')) $label_adr=$label_adr.$this->getValue('adr_foreign');
  33. // $this->getObject()->setLabelAdr($label_adr);
  34. // parent::save($con);
  35. // }
  36. public function doSave($con = null) {
  37. $label_adr="";
  38. if($this->getValue('adr_1')) $label_adr=$this->getValue('adr_1');
  39. $label_adr = $label_adr.'|';
  40. if($this->getValue('adr_2')) $label_adr=$label_adr.$this->getValue('adr_2');
  41. $label_adr = $label_adr.'|';
  42. if($this->getValue('adr_3')) $label_adr=$label_adr.$this->getValue('adr_3');
  43. $label_adr = $label_adr.'|';
  44. if($this->getValue('adr_foreign')) $label_adr=$label_adr.$this->getValue('adr_foreign');
  45.  
  46. $this->getObject()->setLabelAdr($label_adr);
  47. sfContext::getInstance()->getLogger()->alert('ciyiy');
  48. parent::doSave($con);
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement