All pastes #537412 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-04 18:43 UTC
rendered paste body
Index: Validator/Unique.php
===================================================================
--- Validator/Unique.php        (revision 1345)
+++ Validator/Unique.php        (working copy)
@@ -42,7 +42,12 @@
     public function validate(Doctrine_Record $record, $key, $value, $args)
     {
         $table = $record->getTable();
-        $sql   = 'SELECT ' . $table->getIdentifier() . ' FROM ' . $table->getTableName() . ' WHERE ' . $key . ' = ?';
+        $pks = $table->getIdentifier();
+        if ( is_array($pks) ) {
+            $pks = join(',',$pks);
+        }
+
+        $sql   = 'SELECT ' . $pks . ' FROM ' . $table->getTableName() . ' WHERE ' . $key . ' = ?';
         
         $values = array();
         $values[] = $value;