Modified the customer update() function to update all customers if passed null. This would not be a typcial scenario, but it useful at the moment during development.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@603 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-17 06:32:32 +00:00
parent 287d9f8f11
commit 5abe0770b3

View File

@@ -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 <AP>: 20090812
// updateLeaseCount is handled directly when needed.
// Should we simplify by just doing it anyway?