|
|
@@ -1487,7 +1487,11 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
|
|
|
}
|
|
|
$keys = array_fill(0, count($primary), null);
|
|
|
$id = (array)$this->_newId($primary) + $keys;
|
|
|
+
|
|
|
+ // Generate primary keys preferring values in $data.
|
|
|
$primary = array_combine($primary, $id);
|
|
|
+ $primary = array_intersect_key($data, $primary) + $primary;
|
|
|
+
|
|
|
$filteredKeys = array_filter($primary, 'strlen');
|
|
|
$data = $data + $filteredKeys;
|
|
|
|