Skip to content

Commit 64d6265

Browse files
committed
Better Table::insert ignore parameter
1 parent 2272305 commit 64d6265

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PHPFUI/ORM/Table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ public function getWhereCondition() : \PHPFUI\ORM\Condition
752752
* Mass insertion. Does not use a transaction, so surround by a transaction if needed
753753
*
754754
* @param array<\PHPFUI\ORM\Record> $records
755+
* @param string $ignore Pass "ignore" to not error on duplicate records
755756
*/
756757
public function insert(array $records, string $ignore = '') : bool
757758
{
@@ -760,7 +761,7 @@ public function insert(array $records, string $ignore = '') : bool
760761
return false;
761762
}
762763
$tableName = $this->getTableName();
763-
$sql = "insert {$ignore}into `{$tableName}` (";
764+
$sql = "insert {$ignore} into `{$tableName}` (";
764765

765766
$fields = \array_keys($this->getFields());
766767
$comma = '';

0 commit comments

Comments
 (0)