public function setup()
 {
     $this->setWidgets(array('idEntrada' => new sfWidgetFormInputHidden(), 'entrades_preus_horari_id' => new sfWidgetFormInputHidden(), 'usuari_id' => new sfWidgetFormJQueryAutocompleter(array('url' => $this->getOption('ajax')), array('style' => 'width:400px')), 'nom_reserva' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'email_reserva' => new sfWidgetFormInputText(array(), array('style' => 'width:200px')), 'telefon_reserva' => new sfWidgetFormInputText(array(), array('style' => 'width:200px')), 'quantitat' => new sfWidgetFormChoice(array('choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5')), array('style' => 'width:50px')), 'data' => new sfWidgetFormShowText(), 'estat' => new sfWidgetFormInputHidden(), 'tipus_pagament' => new sfWidgetFormChoice(array('choices' => EntradesReservaPeer::getTipusPagaments($this->getOption('IDH'), true)), array('style' => 'width:200px;')), 'descompte' => new sfWidgetFormChoice(array('choices' => DescomptesPeer::getDescomptesEntradesArray($this->getOption('IDH'), true)), array('style' => 'width:200px;')), 'actiu' => new sfWidgetFormInputHidden(), 'site_id' => new sfWidgetFormInputHidden(), 'comentari' => new sfWidgetFormTextarea()));
     if (!$this->isNew()) {
         $this->setWidget('estat', new sfWidgetFormChoice(array('choices' => EntradesReservaPeer::selectEstats())));
     }
     $this->setValidators(array('idEntrada' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdentrada()), 'empty_value' => $this->getObject()->getIdentrada(), 'required' => false)), 'entrades_preus_horari_id' => new sfValidatorInteger(array('min' => -2147483648.0, 'max' => 2147483647)), 'usuari_id' => new sfValidatorInteger(array('min' => -2147483648.0, 'max' => 2147483647, 'required' => false)), 'nom_reserva' => new sfValidatorString(array('required' => false)), 'email_reserva' => new sfValidatorString(array('required' => false)), 'telefon_reserva' => new sfValidatorString(array('required' => false)), 'quantitat' => new sfValidatorInteger(array('min' => -128, 'max' => 127)), 'data' => new sfValidatorDateTime(array('required' => false)), 'estat' => new sfValidatorInteger(array('min' => -32768, 'max' => 32767, 'required' => false)), 'tipus_pagament' => new sfValidatorInteger(array('required' => false), array()), 'descompte' => new sfValidatorInteger(array('required' => false), array()), 'actiu' => new sfValidatorInteger(array('min' => -128, 'max' => 127)), 'site_id' => new sfValidatorInteger(array('min' => -2147483648.0, 'max' => 2147483647, 'required' => false)), 'comentari' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setLabels(array('usuari_id' => 'Usuari hospici: ', 'nom_reserva' => 'Nom: ', 'quantitat' => 'Entrades:', 'data' => 'Data: ', 'tipus_pagament' => 'Pagament?', 'comentari' => 'Comentari: '));
     $this->widgetSchema->setNameFormat('entrades_reserva[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->widgetSchema->setFormFormatterName('Span');
 }
 public function getDescompteString()
 {
     $A_OD = DescomptesPeer::getDescomptesEntradesArray($this->getEntradesPreusHorariId(), true);
     return $A_OD[$this->getDescompte()];
 }