Skip to content

Instantly share code, notes, and snippets.

@cesarockstar1985
Last active February 28, 2023 12:32
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/4d40964aad64a84c97e9d78ce0dca485 to your computer and use it in GitHub Desktop.
Save cesarockstar1985/4d40964aad64a84c97e9d78ce0dca485 to your computer and use it in GitHub Desktop.
foreach ($bestMatchingSureties->toArray() 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');
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