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() ?