original_string: public function getCondition(string $field, array $fieldConf): string
      {
          $type = strtolower($fieldConf['type']);
          $unsigned = $fieldConf['unsigned'];
  
          $integerCast = $this->getIntegerCast($unsigned);
  
          $condition = "(CASE $field WHEN NULL THEN NULL ELSE :$field END)";
  
          $typeToCast = [
              'date' => 'DATE',
              'datetime' => 'DATE',
              'time' => 'TIME',
              'smallint' => $integerCast,
              'integer' => $integerCast,
              'bigint' => $integerCast,
              'float' => 'DECIMAL',
              'decimal' => 'DECIMAL',
          ];
  
          // No cast required
          if (!array_key_exists($type, $typeToCast)) {
              return $condition;
          }
  
          return "CAST($condition AS {$typeToCast[$type]})";
      }
code: public function getCondition(string $field, array $fieldConf): string
      {
          $type = strtolower($fieldConf['type']);
          $unsigned = $fieldConf['unsigned'];
  
          $integerCast = $this->getIntegerCast($unsigned);
  
          $condition = "(CASE $field WHEN NULL THEN NULL ELSE :$field END)";
  
          $typeToCast = [
              'date' => 'DATE',
              'datetime' => 'DATE',
              'time' => 'TIME',
              'smallint' => $integerCast,
              'integer' => $integerCast,
              'bigint' => $integerCast,
              'float' => 'DECIMAL',
              'decimal' => 'DECIMAL',
          ];
  
          // No cast required
          if (!array_key_exists($type, $typeToCast)) {
              return $condition;
          }
  
          return "CAST($condition AS {$typeToCast[$type]})";
      }
code_tokens: public function getCondition ( string $ field , array $ fieldConf ) : string { $ type = strtolower ( $ fieldConf [ 'type' ] ) ; $ unsigned = $ fieldConf [ 'unsigned' ] ; $ integerCast = $ this -> getIntegerCast ( $ unsigned ) ; $ condition = "(CASE $field WHEN NULL THEN NULL ELSE :$field END)" ; $ typeToCast = [ 'date' => 'DATE' , 'datetime' => 'DATE' , 'time' => 'TIME' , 'smallint' => $ integerCast , 'integer' => $ integerCast , 'bigint' => $ integerCast , 'float' => 'DECIMAL' , 'decimal' => 'DECIMAL' , ] ; // No cast required if ( ! array_key_exists ( $ type , $ typeToCast ) ) { return $ condition ; } return "CAST($condition AS {$typeToCast[$type]})" ; }
docstring: Build the condition by casting the value if needed
  
  @param  string $field
  @param  array  $fieldConf Various values about the field
  
  @return string
docstring_tokens: Build the condition by casting the value if needed