/**
  * Filter the query on the unit column
  *
  * @param     mixed $unit The value to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ProductArchiveQuery The current query, for fluid interface
  * @throws PropelException - if the value is not accepted by the enum.
  */
 public function filterByUnit($unit = null, $comparison = null)
 {
     if (is_scalar($unit)) {
         $unit = ProductArchivePeer::getSqlValueForEnum(ProductArchivePeer::UNIT, $unit);
     } elseif (is_array($unit)) {
         $convertedValues = array();
         foreach ($unit as $value) {
             $convertedValues[] = ProductArchivePeer::getSqlValueForEnum(ProductArchivePeer::UNIT, $value);
         }
         $unit = $convertedValues;
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
     }
     return $this->addUsingAlias(ProductArchivePeer::UNIT, $unit, $comparison);
 }
Esempio n. 2
0
 /**
  * Gets the SQL value for Unit ENUM value
  *
  * @param  string $enumVal ENUM value to get SQL value for
  * @return int SQL value
  */
 public static function getUnitSqlValue($enumVal)
 {
     return ProductArchivePeer::getSqlValueForEnum(ProductArchivePeer::UNIT, $enumVal);
 }