Changeset 4693

Show
Ignore:
Timestamp:
07/18/08 02:21:12 (5 months ago)
Author:
jwage
Message:

fixes #1125

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Export.php

    r4358 r4693  
    287287    public function createTable($name, array $fields, array $options = array()) 
    288288    { 
     289        // Build array of the primary keys if any of the individual field definitions 
     290        // specify primary => true 
     291        $count = 0; 
     292        foreach ($fields as $fieldName => $field) { 
     293            if (isset($field['primary']) && $field['primary']) { 
     294                if ($count == 0) { 
     295                    $options['primary'] = array(); 
     296                } 
     297                $count++; 
     298                $options['primary'][] = $fieldName; 
     299            } 
     300        } 
     301 
    289302        $sql = (array) $this->createTableSql($name, $fields, $options); 
    290303