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/site@171 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user