Skip to content

Instantly share code, notes, and snippets.

@cesarockstar1985
Created March 8, 2023 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cesarockstar1985/a4a901553a7cec2e3f9eb3d8f4f11439 to your computer and use it in GitHub Desktop.
Save cesarockstar1985/a4a901553a7cec2e3f9eb3d8f4f11439 to your computer and use it in GitHub Desktop.
foreach ($bestMatchingSureties->all_sureties as $bestMatchingSurety) {
$this->Quotes->getConnection()->transactional(function () use ($bestMatchingSureties, $quote, $requestDataSurety, $bestMatchingSurety) {
$quote = $this->Quotes->selectSurety($requestDataSurety, $quote, $bestMatchingSureties);
$autoApprove = $this->Quotes->Bonds->getMatchingSuretiesById($quote->bond_id, false, 'AutoApprove');
$dataAutoApprove = (int)Hash::get(array_values($autoApprove), '0.data.auto_approve');
$bestMatchingSurety->autoapprove = false;
if ($dataAutoApprove) {
$bestMatchingSurety->autoapprove = true;
}
return false;
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment