* Returns an optional USE INDEX clause to go after the table, and a
* string to go at the end of the query.
*
+ * @see Database::select()
+ *
* @param array $options Associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return array
- * @see Database::select()
*/
- protected function makeSelectOptions( $options ) {
+ protected function makeSelectOptions( array $options ) {
$preLimitTail = $postLimitTail = '';
$startOpts = '';
return "'" . pg_escape_string( $conn, (string)$s ) . "'";
}
- public function makeSelectOptions( $options ) {
+ protected function makeSelectOptions( array $options ) {
$preLimitTail = $postLimitTail = '';
$startOpts = $useIndex = $ignoreIndex = '';
return in_array( 'UNIQUE', $options );
}
- /**
- * Filter the options used in SELECT statements
- *
- * @param array $options
- * @return array
- */
- function makeSelectOptions( $options ) {
+ protected function makeSelectOptions( array $options ) {
+ // Remove problematic options that the base implementation converts to SQL
foreach ( $options as $k => $v ) {
- if ( is_numeric( $k ) && ( $v == 'FOR UPDATE' || $v == 'LOCK IN SHARE MODE' ) ) {
+ if ( is_numeric( $k ) && ( $v === 'FOR UPDATE' || $v === 'LOCK IN SHARE MODE' ) ) {
$options[$k] = '';
}
}