Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Symfony] błąd w sfValidatorPropelChoice
janek9
post 17.10.2009, 00:08:33
Post #1





Grupa: Zarejestrowani
Postów: 121
Pomógł: 2
Dołączył: 22.03.2009

Ostrzeżenie: (0%)
-----


Mam taki kod we formularzu:

  1. class RechargeForm extends BaseTpCodesForm
  2. {
  3. public function configure()
  4. {
  5. unset($this['sn_club'], $this['sn_code'] , $this['is_active'], $this['is_blocked'], $this['is_deleted'], $this['created_at'], $this['id']);
  6.  
  7. $this->widgetSchema['token_code'] = new sfWidgetFormInput();
  8.  
  9. $this->validatorSchema['token_code'] = new sfValidatorAnd(array(new sfValidatorString(array('min_length' => 20, 'max_length' => 20)), new sfValidatorRegex(array('pattern' => '/^[0-9a-z]+$/i'))), array('halt_on_error' => true), array('invalid' => 'Niepoprawny kod.', 'required' => 'Pole wymagane.'));
  10.  
  11. $this->validatorSchema->setPostValidator(new sfValidatorPropelChoice(array('model' => 'TpCodes', 'column' => 'token_code', 'criteria' => TpCodesPeer::retrieveByTokenCode($this['token_code']->getValue())), array('invalid' => 'Niepoprawny kod.', 'required' => 'Pole wymagane.')));
  12.  
  13. $this->widgetSchema->setLabels(array('token_code' => 'Twój kod'));
  14. }
  15. }



wszystko działa, wartość się waliduje tak jak powinn, ale pokazuje się błąd:

  1. Notice: Array to string conversion in /usr/share/php5/PEAR/symfony/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDOStatement.php on line 80


mianowicie nie wiem czy dobrze pozyskuję wartość z pola "token_code" w sfValidatorPropelChoice() ?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.06.2025 - 10:36