示例#1
0
 /**
  * Gets the SQL value for the ENUM column value
  *
  * @param string $colname ENUM column name.
  * @param string $enumVal ENUM value.
  *
  * @return int SQL value
  */
 public static function getSqlValueForEnum($colname, $enumVal)
 {
     $values = ConsultaPeer::getValueSet($colname);
     if (!in_array($enumVal, $values)) {
         throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $colname));
     }
     return array_search($enumVal, $values);
 }