git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@383 97e9348a-65ac-dc4b-aefc-98561f571b83
46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
class TenderType extends AppModel {
|
|
|
|
var $hasMany = array(
|
|
'Tender',
|
|
);
|
|
|
|
/**************************************************************************
|
|
**************************************************************************
|
|
**************************************************************************
|
|
* function: paymentTypes
|
|
* - Returns an array of types that can be used for payments
|
|
*/
|
|
|
|
function paymentTypes($extra = null) {
|
|
$this->cacheQueries = true;
|
|
$accounts = $this->find('all', array
|
|
('contain' => false,
|
|
'order' => array('name'),
|
|
) + (isset($extra) ? $extra : array())
|
|
);
|
|
$this->cacheQueries = false;
|
|
|
|
/* // Rearrange to be of the form (id => name) */
|
|
/* $rel_accounts = array(); */
|
|
/* foreach ($accounts AS $acct) { */
|
|
/* $rel_accounts[$acct['Account']['id']] = $acct['Account']['name']; */
|
|
/* } */
|
|
|
|
return $accounts;
|
|
}
|
|
|
|
|
|
/**************************************************************************
|
|
**************************************************************************
|
|
**************************************************************************
|
|
* function: defaultPaymentTypes
|
|
* - Returns an array of types that can be used for payments
|
|
*/
|
|
|
|
function defaultPaymentType() {
|
|
return $this->nameToID('Check');
|
|
}
|
|
|
|
}
|
|
?>
|