Support abstraction for 'NOT IN' SQL structure
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 13 May 2011 15:39:45 +0000 (15:39 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 13 May 2011 15:39:45 +0000 (15:39 +0000)
commitba564eeb7c73c409e3cbd1063c2ac350d6a7e360
treee7dedda27bfc05523618490dbeee086ab857aa1c
parent7e4d49b9bcd5cb585272eca0b3ba18d71787db42
Support abstraction for 'NOT IN' SQL structure

Following a live discussion with Catrope.

When using Database::makeList() in LIST_AND or LIST_OR modes, you can now
suffix the field name with an exclamation mark.  It will negate the logical
boolean.

Example:
  $db->makeList( array( 'field!' => array( 1,2,3 ) );
  outputs:
    'field' NOT IN ('1', '2', '3' );

 $db->makeList( array( 'foo!' => array( 777 ) ) );
 outputs:
   'foo' =! 777

(note: tests not ran, please run them and ammend them)
includes/db/Database.php
tests/phpunit/includes/db/DatabaseTest.php