68 lines
1.5 KiB
PHP
68 lines
1.5 KiB
PHP
<?php
|
|
class Job extends AppModel {
|
|
|
|
var $name = 'Job';
|
|
var $validate = array(
|
|
'title' => array('notempty'),
|
|
'state_id' => array('numeric'),
|
|
'customer_id' => array('numeric'),
|
|
'enquiry_id' => array('numeric'),
|
|
'contact_id' => array('numeric'),
|
|
'date_order_received' => array('date'),
|
|
'customer_order_number' => array('notempty'),
|
|
'domestic_freight_paid_by' => array('notempty'),
|
|
'sale_category' => array('notempty'),
|
|
'shipment_category' => array('notempty')
|
|
);
|
|
|
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
|
var $belongsTo = array(
|
|
'State' => array(
|
|
'className' => 'State',
|
|
'foreignKey' => 'state_id',
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => ''
|
|
),
|
|
'Customer' => array(
|
|
'className' => 'Customer',
|
|
'foreignKey' => 'customer_id',
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => ''
|
|
),
|
|
'Enquiry' => array(
|
|
'className' => 'Enquiry',
|
|
'foreignKey' => 'enquiry_id',
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => '',
|
|
'counterCache' => true
|
|
),
|
|
'Contact' => array(
|
|
'className' => 'Contact',
|
|
'foreignKey' => 'contact_id',
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => ''
|
|
)
|
|
);
|
|
|
|
/*var $hasMany = array(
|
|
'JobProduct' => array(
|
|
'className' => 'JobProduct',
|
|
'foreignKey' => 'job_id',
|
|
'dependent' => false,
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => '',
|
|
'limit' => '',
|
|
'offset' => '',
|
|
'exclusive' => '',
|
|
'finderQuery' => '',
|
|
'counterQuery' => ''
|
|
)
|
|
);*/
|
|
|
|
}
|
|
?>
|