Conn2Flow
Docs navigation

Reference / Libraries

atualizacoes-choques.php library

Clash records in the database: list, detail with both versions and resolution (req-199).

Path in the Gestor bibliotecas/atualizacoes-choques.php

Connects the pure engine of instalacao-manifesto.php to the atualizacoes_choques table (req-199 / BATCH-205). The panel (admin-atualizacoes) and the API (/_api/project/conflicts and /_api/project/resolve) use the same functions, so a decision is the same whether it comes from the panel, the CLI or the VS Code extension.

Usage

  • atualizacoes_choques_disponivel() tells whether the table exists (the migration may not have run).

  • atualizacoes_choques_listar($pendentes, $limite) lists clashes, most recent first, without the diff, with the possible decisions in acoes.

  • atualizacoes_choques_obter($id) returns one row with the diff.

  • atualizacoes_choques_detalhe($base, $id) joins the row and both versions (live and new); a binary file comes in base64.

  • atualizacoes_choques_resolver($base, $id, $acao, $mesclado, $quem) applies the decision through the engine and records resolucao, resolvido_em and resolvido_por on the row and on the other pending rows of the same file and layer (earlier versions of the same clash). An already resolved clash is refused.

  • atualizacoes_choques_resolver_registro($choque, $acao) resolves a record clash (db:<table>?<key>, from declarative data removal, BATCH-207): "overwrite" accepts the removal (status='D' or deleted) and "keep" leaves the record.

Functions

Generated from gestor/bibliotecas/atualizacoes-choques.php · 6 functions

6 of 6

atualizacoes_choques_listar

view source · line 26 ↗
atualizacoes_choques_listar(bool $pendentes = true, int $limite = 100): array

Choques do registro, mais recentes primeiro.

Parameters

$pendentesbool
Só os sem resolução.
$limiteint

Returns

array
Linhas sem o diff (id, data_criacao, origem, camada, versao, caminho, tipo, motivo,

atualizacoes_choques_detalhe

view source · line 56 ↗
atualizacoes_choques_detalhe(string $base, int $id): ?array

Detalhe para quem decide: a linha, as duas versões (no ar e nova) e o diff. Binário vai em base64.

Parameters

$basestring
$idint

Returns

?array
['choque' => linha, 'no_ar' => string|null, 'nova' => string|null, 'binario' => bool, 'codificacao' => 'texto'|'base64']

atualizacoes_choques_resolver_registro

view source · line 72 ↗
atualizacoes_choques_resolver_registro(array $c, string $acao): array

req-199 / BATCH-207: choque de **registro** (db:<tabela>?<chave>), de uma retirada declarativa em que o registro foi editado online. sobrescrever aceita a retirada (status='D' quando a tabela tem status, senão sai); manter deixa o registro (o manifesto do dono já não o lista, então não volta a chocar).

Parameters

$carray
$acaostring

Returns

array
['ok' => bool, 'erro' => string, 'acao' => string]

atualizacoes_choques_resolver

view source · line 102 ↗
atualizacoes_choques_resolver(string $base, int $id, string $acao, ?string $mesclado, string $quem): array

Aplica a decisão (motor) e registra: a linha e as outras pendentes do mesmo arquivo e camada (versões anteriores do mesmo choque) recebem a resolução, a data e quem decidiu.

Parameters

$basestring
$idint
$acaostring
$mesclado?string
$quemstring

Returns

array
['ok' => bool, 'erro' => string, 'acao' => string, 'resolvidos' => int]

The Future is Hybrid: Human + AI.

Conn2Flow is the tool. If you need the Architect to design your company's strategy using this technology...

Hire Specialized Consulting