X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=sql%2FGenerateData.php;h=057d8af5a13643d39e93d3f1472d5089f484d098;hb=435a9dcdb3a6518b2e8347bb2828f0c568191439;hp=8875a4081f85e61f61a1a4808086d4e1322fe872;hpb=a3628d0b7a4d5d253fa38d87ddc7eb2525ef2775;p=civicrm-core.git diff --git a/sql/GenerateData.php b/sql/GenerateData.php index 8875a4081f..057d8af5a1 100644 --- a/sql/GenerateData.php +++ b/sql/GenerateData.php @@ -270,6 +270,7 @@ class CRM_GCD { private $groupMembershipStatus = array('Added', 'Removed', 'Pending'); private $subscriptionHistoryMethod = array('Admin', 'Email'); + private $deceasedContactIds = array(); /********************************* * private methods @@ -649,7 +650,13 @@ class CRM_GCD { } // Deceased probability based on age - if ($age > 40) { + if ($contact->gender_id && $contact->gender_id == 2) { + $checkAge = 64; + } + else { + $checkAge = 68; + } + if ($age > $checkAge && count($this->deceasedContactIds) < 4) { $contact->is_deceased = $this->probability(($age - 30) / 100); if ($contact->is_deceased && $this->probability(.7)) { $contact->deceased_date = $this->randomDate(); @@ -686,6 +693,9 @@ class CRM_GCD { $contact->hash = crc32($contact->sort_name); $contact->id = $cid; $this->_update($contact); + if ($contact->is_deceased) { + $this->deceasedContactIds[] = $cid; + } } }