Moved date formatting fully into the AppModel, automatically determining the necessary fields from the schema.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@233 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -34,21 +34,6 @@ class Lease extends AppModel {
|
||||
);
|
||||
|
||||
|
||||
function beforeSave() {
|
||||
foreach (array('lease',
|
||||
'movein', 'movein_planned',
|
||||
'moveout', 'moveout_planned',
|
||||
'notice_givein', 'notice_received',
|
||||
'close', 'next_rent') AS $dtfield) {
|
||||
$dtfield .= '_date';
|
||||
if(isset($this->data['Lease'][$dtfield]))
|
||||
$this->data['Lease'][$dtfield] =
|
||||
$this->dateFormatBeforeSave($this->data['Lease'][$dtfield]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user