* @param string $cls Class to fetch
* @param string $keyCol name of column for key
* @param array $keyVals key values to fetch
+ * @param boolean $skipNulls skip provided null values
*
* @return array Array of objects, in order
*/
- static function multiGetClass($cls, $keyCol, array $keyVals)
+ static function multiGetClass($cls, $keyCol, array $keyVals, $skipNulls=true)
{
$obj = new $cls;
throw new ServerException('Cannot do multiGet on anything but integer columns');
}
+ if ($skipNulls) {
+ foreach ($keyVals as $key=>$val) {
+ if (is_null($val)) {
+ unset($keyVals[$key]);
+ }
+ }
+ }
+
$obj->whereAddIn($keyCol, $keyVals, $colType);
// Since we're inputting straight to a query: format and escape