Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
mergetrait.php
1<?php
2
11
12trait MergeTrait
13{
18 public static function merge(array $insertFields, array $updateFields, ?array $uniqueFields = null)
19 {
20 $entity = static::getEntity();
21 $conn = $entity->getConnection();
22 $primary = $uniqueFields === null ? $entity->getPrimaryArray() : $uniqueFields;
23
24 $sql = $conn->getSqlHelper()->prepareMerge(static::getTableName(), $primary, $insertFields, $updateFields);
25
26 $conn->queryExecute(current($sql));
27
28 static::cleanCache();
29 }
30}