Senin, 10 Juni 2013

Model Cake PHP

class TAgreement extends AppModel {
  var $name = 'TAgreement';
   
  var $belongsTo = array(
        'TQuotation' => array(
            'className' => 'TQuotation',       
            'foreignKey' => 't_quotation_id'
        ),
        'MCustomer' => array(
            'className' => 'MCustomer',
            'foreignKey' => 'm_customer_id',
        ),
        'MEmployee' => array(
            'className' => 'MEmployee',
            'foreignKey' => 'salesperson_id',
        ),
    );
   
    var $hasOne = array(
        'TAgreementUpload' => array(
            'className' => 'TAgreementUpload',       
            'foreignKey' => 't_agreement_id'
        )
    );
   
    var $hasMany = array(
        'TAgreementDetail' => array(
            'className' => 'TAgreementDetail',       
            'foreignKey' => 't_agreement_id'
        )
    );
   
}
?>

0 komentar:

Posting Komentar