$this->connection,
$this->connection->
prepare('UPDATE `rule` SET payload = :payload, invalid = :invalid WHERE id = :id'
) );
$updated =
[];
/** @var string $id */
foreach ($rules as $id =>
$rule) { $invalid = false;
$serialized = null;
try { $nested =
$this->
buildNested($rule, null
);
// ensure the root rule is an AndRule
$nested =
new AndRule($nested);
$serialized =
serialize($nested);
} catch (ConditionTypeNotFound
) { $invalid = true;
} finally { $update->
execute([ 'id' => Uuid::
fromHexToBytes($id),
'payload' =>
$serialized,