59 lines
1.3 KiB
PHP
Executable file
59 lines
1.3 KiB
PHP
Executable file
<?php
|
|
class Contact extends AppModel {
|
|
|
|
var $name = 'Contact';
|
|
|
|
var $validate = array(
|
|
'first_name' => array(
|
|
'rule' => array('notEmpty'),
|
|
'message' => 'Please Enter the First Name of the Contact',
|
|
'required' => true,
|
|
'allowEmpty' => false
|
|
),
|
|
|
|
'last_name' => array(
|
|
'rule' => array('notEmpty'),
|
|
'message' => 'Please Enter the Last Name of the Contact',
|
|
'required' => true,
|
|
'allowEmpty' => false
|
|
),
|
|
'email' => array(
|
|
'rule' => array('email'),
|
|
'message' => 'Please a valid Email Address for the Contact',
|
|
'required' => false,
|
|
'allowEmpty' => true
|
|
)
|
|
);
|
|
|
|
|
|
|
|
|
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
|
var $belongsTo = array(
|
|
'Customer' => array('className' => 'Customer',
|
|
'foreignKey' => 'customer_id',
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => ''
|
|
)
|
|
);
|
|
|
|
var $hasMany = array(
|
|
'Enquiry' => array('className' => 'Enquiry',
|
|
'foreignKey' => 'contact_id',
|
|
'dependent' => false,
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => '',
|
|
'limit' => '',
|
|
'offset' => '',
|
|
'exclusive' => '',
|
|
'finderQuery' => '',
|
|
'counterQuery' => ''
|
|
)
|
|
);
|
|
|
|
|
|
}
|
|
?>
|