cmc-sales/models/document.php
2011-05-19 09:46:22 +10:00

50 lines
1.1 KiB
PHP
Executable file

<?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' => ''
)
);
var $hasMany = array(
'LineItem' => array(
'className' => 'LineItem',
'foreignKey' => 'document_id'
),
'DocPage' => array(
'className'=> 'DocPage',
'foreignKey' => 'document_id',
'order' => 'DocPage.page_number ASC'
)
);
var $hasOne = array(
'Invoice' => array(
'className' => 'Invoice',
'foreignKey'=> 'document_id'
),
'Quote' => array(
'className'=>'Quote',
'foriegnKey'=>'document_id'
),
'PurchaseOrder' => array(
'className'=>'PurchaseOrder',
'foreignKey'=>'document_id'
)
);
}
?>