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:
@@ -233,6 +233,18 @@ class Customer extends AppModel {
|
|||||||
function update($id) {
|
function update($id) {
|
||||||
$this->prEnter(compact('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
|
// REVISIT <AP>: 20090812
|
||||||
// updateLeaseCount is handled directly when needed.
|
// updateLeaseCount is handled directly when needed.
|
||||||
// Should we simplify by just doing it anyway?
|
// Should we simplify by just doing it anyway?
|
||||||
|
|||||||
Reference in New Issue
Block a user