src/Entity/Savers/BulkEntityUpdater.php
private function convertExtractedToSqlRow(array $extracted): string
    {
        if ([] === $extracted) {
            throw new \RuntimeException('Extracted array is empty in ' . __METHOD__);
        }
        $primaryKeyCol = null;
        $primaryKey    = null;
        $sql           = "update `{$this->tableName}` set ";
        $sqls          = [];
        foreach ($extracted as $key => $value) {
            if (null === $primaryKeyCol) {
                $primaryKeyCol = $key;
                $primaryKey    = $this->convertUuidToSqlString($value);
                continue;
            }
            $value  = $this->mysqli->escape_string((string)$value);
            $sqls[] = "`$key` = '$value'";
        }
        $sql .= implode(",\n", $sqls);
        $sql .= " where `$primaryKeyCol` = $primaryKey; ";

        return $sql;
    }
private function convertExtractedToSqlRow(array $extracted): string
    {
        if ([] === $extracted) {
            throw new \RuntimeException('Extracted array is empty in ' . __METHOD__);
        }
        $primaryKeyCol = null;
        $primaryKey    = null;
        $sql           = "update `{$this->tableName}` set ";
        $sqls          = [];
        foreach ($extracted as $key => $value) {
            if (null === $primaryKeyCol) {
                $primaryKeyCol = $key;
                $primaryKey    = $this->convertUuidToSqlString($value);
                continue;
            }
            $value  = $this->mysqli->escape_string((string)$value);
            $sqls[] = "`$key` = '$value'";
        }
        $sql .= implode(",\n", $sqls);
        $sql .= " where `$primaryKeyCol` = $primaryKey; ";

        return $sql;
    }
private function convertExtractedToSqlRow ( array $ extracted ) : string { if ( [ ] === $ extracted ) { throw new \ RuntimeException ( 'Extracted array is empty in ' . __METHOD__ ) ; } $ primaryKeyCol = null ; $ primaryKey = null ; $ sql = "update `{$this->tableName}` set " ; $ sqls = [ ] ; foreach ( $ extracted as $ key => $ value ) { if ( null === $ primaryKeyCol ) { $ primaryKeyCol = $ key ; $ primaryKey = $ this -> convertUuidToSqlString ( $ value ) ; continue ; } $ value = $ this -> mysqli -> escape_string ( ( string ) $ value ) ; $ sqls [ ] = "`$key` = '$value'" ; } $ sql .= implode ( ",\n" , $ sqls ) ; $ sql .= " where `$primaryKeyCol` = $primaryKey; " ; return $ sql ; }
Take the extracted array and build an update query

@param array $extracted

@return string
Take the extracted array and build an update query