Development

Changeset 5838

You must first sign up to be able to contribute.

Changeset 5838

Show
Ignore:
Timestamp:
11/04/07 15:20:57 (10 months ago)
Author:
fabien
Message:

added sfCallable support to sfValidatorChoiceMany

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/validator/sfValidatorChoiceMany.class.php

    r5757 r5838  
    2929    } 
    3030 
     31    $choices = $this->getOption('choices'); 
     32    if ($choices instanceof sfCallable) 
     33    { 
     34      $choices = $choices->call(); 
     35    } 
     36 
    3137    foreach ($values as $value) 
    3238    { 
    33       if (!in_array($value, $this->getOption('choices'))) 
     39      if (!in_array($value, $choices)) 
    3440      { 
    3541        throw new sfValidatorError($this, 'invalid', array('value' => $value));