2009-01-12 21:13:18 -08:00
|
|
|
<?php
|
|
|
|
|
class User extends AppModel {
|
|
|
|
|
|
2011-01-11 00:52:52 -08:00
|
|
|
var $name = 'User';
|
2010-05-03 22:52:33 -07:00
|
|
|
|
|
|
|
|
|
2011-01-11 00:52:52 -08:00
|
|
|
var $displayField = 'username';
|
|
|
|
|
|
|
|
|
|
/* TO DO: Fix up this validation stuff
|
2009-01-12 21:13:18 -08:00
|
|
|
var $validate = array(
|
|
|
|
|
'username' => array(
|
|
|
|
|
'rule' => 'unique',
|
|
|
|
|
'required' => true,
|
|
|
|
|
'message' => 'Username must be unique'
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// 'password' => array('maxlength'),
|
|
|
|
|
'email' => array('email'),
|
|
|
|
|
// 'job_title' => array('custom')
|
|
|
|
|
);
|
2011-01-11 00:52:52 -08:00
|
|
|
*/
|
|
|
|
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
|
|
|
|
var $hasMany = array(
|
|
|
|
|
'Enquiry' => array('className' => 'Enquiry',
|
|
|
|
|
'foreignKey' => 'user_id',
|
|
|
|
|
'dependent' => false,
|
|
|
|
|
'conditions' => '',
|
|
|
|
|
'fields' => '',
|
|
|
|
|
'order' => '',
|
|
|
|
|
'limit' => '',
|
|
|
|
|
'offset' => '',
|
|
|
|
|
'exclusive' => '',
|
|
|
|
|
'finderQuery' => '',
|
|
|
|
|
'counterQuery' => ''
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $belongsTo = array(
|
|
|
|
|
'Principle' => array('className'=>'Principle',
|
|
|
|
|
'foreignKey' =>'principle_id',
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
'Customer' => array('className'=>'Customer',
|
|
|
|
|
'foreignKey' =>'customer_id',
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
);
|
2009-01-12 21:13:18 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2009-10-10 00:06:46 -07:00
|
|
|
?>
|