public static function doValidate($dbName, $tableName, $columns)
    {
        $dbMap = Propel::getDatabaseMap($dbName);
        $tableMap = $dbMap->getTable($tableName);
        $failureMap = array(); // map of ValidationFailed objects
        foreach ($columns as $colName => $colValue) {
            if ($tableMap->hasColumn($colName)) {
                $col = $tableMap->getColumn($colName);
                foreach ($col->getValidators() as $validatorMap) {
                    $validator = BasePeer::getValidator($validatorMap->getClass());
                    if ($validator && ($col->isNotNull() || $colValue !== null) && $validator->isValid($validatorMap, $colValue) === false) {
                        // for now we do one ValidationFailed per column, not per rule
                        if (!isset($failureMap[$colName])) {
                            $failureMap[$colName] = new ValidationFailed($colName, $validatorMap->getMessage(), $validator);
                            break;
                        }
                    }
                }
            }
        }

        return (!empty($failureMap) ? $failureMap : true);
    }