We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff8be33 commit b43ffdeCopy full SHA for b43ffde
src/PHPFUI/ORM/Table.php
@@ -782,7 +782,13 @@ public function insert(array $records, string $ignore = '') : bool
782
$tableName = $this->getTableName();
783
$sql = "insert {$ignore} into `{$tableName}` (";
784
785
- $fields = \array_keys($this->getFields());
+ // remove primary keys
786
+ $fieldDefinitions = $this->getFields();
787
+ foreach ($this->getPrimaryKeys() as $key)
788
+ {
789
+ unset($fieldDefinitions[$key]);
790
+ }
791
+ $fields = \array_keys($fieldDefinitions);
792
$comma = '';
793
794
foreach ($fields as $fieldName)
0 commit comments