Got rid of the custom paging functions, since it's no longer used, and added a function to convert dates into SQL format. Added a beforeSave callout to Transaction to convert the date before saving.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@171 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-19 16:21:16 +00:00
parent 1508f963d3
commit dc6e399fea
2 changed files with 21 additions and 52 deletions

View File

@@ -2,10 +2,9 @@
class Transaction extends AppModel {
var $name = 'Transaction';
var $validate = array(
'id' => array('numeric'),
'stamp' => array('time')
);
/* var $validate = array( */
/* 'stamp' => array('date') */
/* ); */
var $belongsTo = array(
'Customer',
@@ -15,5 +14,15 @@ class Transaction extends AppModel {
'LedgerEntry',
);
function beforeSave() {
if(!empty($this->data['Transaction']['stamp'])) {
$this->data['Transaction']['stamp'] =
$this->dateFormatBeforeSave($this->data['Transaction']['stamp']);
}
return true;
}
}
?>