original_string: protected function where_clause_list($field, array $values) {
          if (empty($values)) {
              return array("1 = 2", array()); // Fake condition, won't return rows ever. MDL-17645
          }
  
          // Note: Do not use get_in_or_equal() because it can not deal with bools and nulls.
  
          $params = array();
          $select = "";
          $values = (array)$values;
          foreach ($values as $value) {
              if (is_bool($value)) {
                  $value = (int)$value;
              }
              if (is_null($value)) {
                  $select = "$field IS NULL";
              } else {
                  $params[] = $value;
              }
          }
          if ($params) {
              if ($select !== "") {
                  $select = "$select OR ";
              }
              $count = count($params);
              if ($count == 1) {
                  $select = $select."$field = ?";
              } else {
                  $qs = str_repeat(',?', $count);
                  $qs = ltrim($qs, ',');
                  $select = $select."$field IN ($qs)";
              }
          }
          return array($select, $params);
      }
code: protected function where_clause_list($field, array $values) {
          if (empty($values)) {
              return array("1 = 2", array()); // Fake condition, won't return rows ever. MDL-17645
          }
  
          // Note: Do not use get_in_or_equal() because it can not deal with bools and nulls.
  
          $params = array();
          $select = "";
          $values = (array)$values;
          foreach ($values as $value) {
              if (is_bool($value)) {
                  $value = (int)$value;
              }
              if (is_null($value)) {
                  $select = "$field IS NULL";
              } else {
                  $params[] = $value;
              }
          }
          if ($params) {
              if ($select !== "") {
                  $select = "$select OR ";
              }
              $count = count($params);
              if ($count == 1) {
                  $select = $select."$field = ?";
              } else {
                  $qs = str_repeat(',?', $count);
                  $qs = ltrim($qs, ',');
                  $select = $select."$field IN ($qs)";
              }
          }
          return array($select, $params);
      }
code_tokens: protected function where_clause_list ( $ field , array $ values ) { if ( empty ( $ values ) ) { return array ( "1 = 2" , array ( ) ) ; // Fake condition, won't return rows ever. MDL-17645 } // Note: Do not use get_in_or_equal() because it can not deal with bools and nulls. $ params = array ( ) ; $ select = "" ; $ values = ( array ) $ values ; foreach ( $ values as $ value ) { if ( is_bool ( $ value ) ) { $ value = ( int ) $ value ; } if ( is_null ( $ value ) ) { $ select = "$field IS NULL" ; } else { $ params [ ] = $ value ; } } if ( $ params ) { if ( $ select !== "" ) { $ select = "$select OR " ; } $ count = count ( $ params ) ; if ( $ count == 1 ) { $ select = $ select . "$field = ?" ; } else { $ qs = str_repeat ( ',?' , $ count ) ; $ qs = ltrim ( $ qs , ',' ) ; $ select = $ select . "$field IN ($qs)" ; } } return array ( $ select , $ params ) ; }
docstring: Returns SQL WHERE conditions for the ..._list group of methods.
  
  @param string $field the name of a field.
  @param array $values the values field might take.
  @return array An array containing sql 'where' part and 'params'
docstring_tokens: Returns SQL WHERE conditions for the ... _list group of methods .