Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Address form.
- *
- * @package new_ref
- * @subpackage form
- * @author Your name here
- * @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
- */
- class AddressForm extends BaseAddressForm
- {
- public function configure()
- {
- $this->useFields(array('apogee_pays_id'));//, 'adr_1', 'adr2', 'adr_3', 'adr_foreign'));
- $this->widgetSchema['adr_1'] = new sfWidgetFormInputText();
- $this->validatorSchema['adr_1'] = new sfValidatorString();
- $this->widgetSchema['adr_2'] = new sfWidgetFormInputText();
- $this->validatorSchema['adr_2'] = new sfValidatorString();
- $this->widgetSchema['adr_3'] = new sfWidgetFormInputText();
- $this->validatorSchema['adr_3'] = new sfValidatorString();
- $this->widgetSchema['adr_foreign'] = new sfWidgetFormInputText();
- $this->validatorSchema['adr_foreign'] = new sfValidatorString();
- }
- // public function save($con = null) {
- // if($this->getValue('adr_1')) $label_adr=$this->getValue('adr_1');
- // $label_adr = $label_adr.'|';
- // if($this->getValue('adr_2')) $label_adr=$label_adr.$this->getValue('adr_2');
- // $label_adr = $label_adr.'|';
- // if($this->getValue('adr_3')) $label_adr=$label_adr.$this->getValue('adr_3');
- // $label_adr = $label_adr.'|';
- // if($this->getValue('adr_foreign')) $label_adr=$label_adr.$this->getValue('adr_foreign');
- // $this->getObject()->setLabelAdr($label_adr);
- // parent::save($con);
- // }
- public function doSave($con = null) {
- $label_adr="";
- if($this->getValue('adr_1')) $label_adr=$this->getValue('adr_1');
- $label_adr = $label_adr.'|';
- if($this->getValue('adr_2')) $label_adr=$label_adr.$this->getValue('adr_2');
- $label_adr = $label_adr.'|';
- if($this->getValue('adr_3')) $label_adr=$label_adr.$this->getValue('adr_3');
- $label_adr = $label_adr.'|';
- if($this->getValue('adr_foreign')) $label_adr=$label_adr.$this->getValue('adr_foreign');
- $this->getObject()->setLabelAdr($label_adr);
- sfContext::getInstance()->getLogger()->alert('ciyiy');
- parent::doSave($con);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement