2010-07-07 23:18:04 -07:00
|
|
|
<?php
|
|
|
|
|
class Document extends AppModel {
|
|
|
|
|
|
|
|
|
|
var $name = 'Document';
|
|
|
|
|
|
|
|
|
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
|
|
|
|
var $belongsTo = array(
|
|
|
|
|
|
|
|
|
|
'User' => array(
|
|
|
|
|
'className' => 'User',
|
|
|
|
|
'foreignKey' => 'user_id',
|
|
|
|
|
'conditions' => '',
|
|
|
|
|
'fields' => '',
|
|
|
|
|
'order' => ''
|
2011-05-15 23:13:21 -07:00
|
|
|
)
|
2010-07-07 23:18:04 -07:00
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
var $hasMany = array(
|
2011-05-15 23:13:21 -07:00
|
|
|
|
|
|
|
|
'LineItem' => array(
|
|
|
|
|
'className' => 'LineItem',
|
|
|
|
|
'foreignKey' => 'document_id'
|
2010-07-07 23:18:04 -07:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $hasOne = array(
|
|
|
|
|
'Invoice' => array(
|
|
|
|
|
'className' => 'Invoice',
|
|
|
|
|
'foreignKey'=> 'document_id'
|
|
|
|
|
),
|
|
|
|
|
'Quote' => array(
|
|
|
|
|
'className'=>'Quote',
|
|
|
|
|
'foriegnKey'=>'document_id'
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
'PurchaseOrder' => array(
|
|
|
|
|
'className'=>'PurchaseOrder',
|
|
|
|
|
'foreignKey'=>'document_id'
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
?>
|