diff --git a/site/models/customer.php b/site/models/customer.php index 10fcd41..3df1ebb 100644 --- a/site/models/customer.php +++ b/site/models/customer.php @@ -233,6 +233,18 @@ class Customer extends AppModel { function update($id) { $this->prEnter(compact('id')); + if (empty($id)) { + $customers = $this->find('all', array('contain' => false, 'fields' => array('id'))); + foreach ($customers AS $customer) { + // This SHOULDN'T happen, but check to be sure + // or we'll get infinite recursion. + if (empty($customer['Customer']['id'])) + continue; + $this->update($customer['Customer']['id']); + } + return; + } + // REVISIT : 20090812 // updateLeaseCount is handled directly when needed. // Should we simplify by just doing it anyway?