Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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