Skip to content
Snippets Groups Projects
Commit d3b60a94 authored by pratik.joshi's avatar pratik.joshi
Browse files

CRM-12726 : code improvement

parent 55033e60
No related branches found
No related tags found
No related merge requests found
......@@ -788,10 +788,10 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
// delete cases related to contact
$contactCases = CRM_Case_BAO_Case::retrieveCaseIdsByContactId($id);
if (!empty($contactCases)) {
foreach($contactCases as $caseId){
foreach ($contactCases as $caseId) {
//check if case is associate with other contact or not.
$caseContactId = CRM_Case_BAO_Case::getCaseClients($caseId);
if(count($caseContactId) <= 1){
if (count($caseContactId) <= 1) {
CRM_Case_BAO_Case::deleteCase($caseId);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment