<?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(
		
		'Enquiry' => array(
			'className' => 'Enquiry',
			'foreignKey' => 'enquiry_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Job' => array(
			'className' => 'Job',
			'foreignKey' => 'job_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Contact' => array(
			'className' => 'Contact',
			'foreignKey' => 'contact_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),

	);

	var $hasMany = array(
		'Page' => array(
			'className' => 'Page',
			'foreignKey' => 'document_id',
			'dependent' => false
		)
	);


        var $hasOne = array(
                'Invoice'   => array(
                    'className' => 'Invoice',
                    'foreignKey'=> 'document_id'
                ),
                'Quote' => array(
                      'className'=>'Quote',
                      'foriegnKey'=>'document_id'
                ),

                'PurchaseOrder' => array(
                    'className'=>'PurchaseOrder',
                    'foreignKey'=>'document_id'
                )
        );
}
?>